Unable to load script from assets in react native & #39; index. android. bundle & #39; solution,

Source: Internet
Author: User

Unable to load script from assets 'index. android. bundle' solution in react native,

 


A friend just asked me to create a project and reported the following error: Unable to load script from assets 'index. android. bundle '. This problem has not occurred before, so I found a solution and shared it.

 

 

The solution to this problem is:
Enter the mian file under the src file under the app directory under the android directory under the root directory of your project (which may be a bit of a wrap), under the main folder, create an assets file, which is the resource folder of rn!
 
Then, use dos to enter the root directory of your project and execute the following command:
React-native bundle -- platform android -- dev false -- entry-file index. android. js -- bundle-output android/app/src/main/assets/index. android. bundle -- assets-dest android/app/src/main/res

After the command is successfully executed, the following result is returned:

Okay, then you can run your command, react-native run-android

 

Now the above problem has been solved, but the new problem has appeared again, and the log console has not been popped up, so we will find the answer to this question. If you encounter the same problem, if you have found the answer, please share it!

 

 

Related Article

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.