Skip to content

How to bundle debug build without packager running #678

@Billydubb

Description

@Billydubb

Ask your Question

I am trying to bundle and build the debug build of the application to put on the phone and have it run without the packager running.

What I have tried so far are the following two ways:

react-native bundle --dev false --platform android --entry-file index.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug

and

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

after each of which I then ran ./gradlew assembleDebug to create the APK.

In either case the app did not run. I get an error with the message
"Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release"

So my questions are:

  • How do create a debug build which I can run without the packager running
  • Where can I tell gradle where to look for the bundle and the assets? ( My assumption is, that gradle couldn't find the generated bundle and the assets?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions