React-native study notes--first install APK to 5 error

Source: Internet
Author: User
Tags blank page install node



This article refers directly to the great God Document:


"Windows environment React native" Com.android.ddmlib.InstallException:Failed to establish session white screen problem resolution





Details:



Today, can be calculated to change the name of the bug. Do not have, who let oneself too vegetable, sister does not love, so idle to Nothing, swing hoe move reactnative.






Reactnative theory does not say, anyway online more is. If I can say, I am not here nonsense, directly into the actual combat.






First, you have to install the Java JDK, install the Android environment, and configure Android.



: http://www.androiddevtools.cn/of course, I recommend you or buy a VPN, the price is not expensive



This specific process, I do not say, I do not think you can see my blog is not an Android programmer, not to mention Baidu is a bunch of things, you think I will go to write it (after all, write no one else to write good AH)



In short, this step, all your configurations must be able to meet the following requirements (particularly idiotic requirements):






When you are in the cmd black window, typing: Android or adb or Java can be a bunch of I do not know your English level of white font, congratulations, you can write Java version of the Android code.



At this point, our task completes the first step.






Second, install Git

Git is required to install react-native, and if Git is not configured, you need to download the corresponding client first

: Git






Then, install node. js



: https://nodejs.org/en/, after download or in black box cmd command line input NPM test if you see a large string of white on the success



It's recommended to install Python somewhere else, and I don't have it installed.






Installing the react-native command-line tool
Continue to enter the command in the black box cmd npm install-g react-native-cli






By this point, the underlying environment has been configured and we are now going to start creating the project






Continue the Black window inside the command line input react-native init MyProject



At this time, wait patiently



......



....



...



.



Lie down, why are you so slow?



I think you must wait impatiently, then why not pay for a VPN, so cheap?



However, we programmers so hard, how can we use the money to buy a VPN instead of to invite girls out to play?



So, you can solve this: https://cnodejs.org/topic/4f9904f9407edba21468f31e



However, I still recommend you to buy a VPN ...



Wait wait ah, sister said I want to be patient, finally not to 200M file finally download complete






Open the Downloaded Awesomeproject folder, open the cmd command line in the directory again, enter react-native start, wait for a while:









At this point, open the browser, enter Http://localhost:8081/index.android.bundle?platform=android, see






If the above script content appears, the server side is already available.






This time, we can go to the mobile phone running program, the PIT is special!



Personal like to run the program directly on the phone, so the cock silk machine red rice note3 pit came, of course, this pit I think  even all non-native systems may have problems:






Compile code package to phone awesomeproject file directory use cmd input command react-native run-android









Crash Ah, at that time, various attempts, adb restart, mobile phone restart, Baidu Google, are not special .....






This time I brought the company's test machine Google Pro son original Android system, perfect stress-free, I know the reason, millet system pot



Finally, the solution:  phone settings-------Developer options---------enable MIUI optimization off



Perfect solution!






Finally installed, but not the white screen, reactnative installation White screen, this is what ghost



Continue to chop millet system, finally set up to find application management, we installed the Awesomeproject application rights management inside, open the suspended window permissions.






Re-open the installed Awesomeproject, we entered the page, the first time to display:









Pick up your phone and shake it, pop the hover window, click Dev Settings and then click Debug Server Host & port for device



Enter your computer's IP here (see method: cmd Window input ipconfig), such as I am 192.168.x.xxx:8081, 8081 is fixed port number, front is your IP






After setting up, go back to the blank page, shake the phone again, choose Reload JS, the program will run up, appear welcome to React native!












Reactnative welcome you, friend!



React-native study notes--first install APK to 5 error


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.