Unable to load script from assets ' index.android bundle '

Source: Internet
Author: User

When you run the React-native project on an Android phone

Error: Unable to load script from assets ' index.android bundle ', make sure your bundle is packaged correctly or youu ' re runin G A Packager server

Solution:

First step: Create a assets empty folder under the Android/app/src/main directory

Step Two: Execute the following command

    1. 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/

Will find two more files under the Assets folder

Step three: Re-run the program.

Summarize:

This index.android.bundle is undoubtedly the JS script used to invoke the native control, each time you change the Index.android.js, you need to use the code snippet above, to update the index.android.bundle in a timely manner, and then package before you can put the new Index.android.js application, so when there is no Index.android.bundle file, RN is no The method of operation.

see:http://blog.csdn.net/u014175342/article/details/73823904

Unable to load script from assets ' index.android bundle '

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.