, , RN APK.
.js
wget RN Node.JS bundle.js:
wget "http://127.0.0.1:8081/index.android.bundle?platform=android&dev=false" -O bundle.js
bundle.js
bundle.js assets/.
, RN
, (bundle.js) . .
, .
build.gradle, android node, :
productFlavors {
bundled {
buildConfigField 'boolean', 'BUNDLED', 'true'
buildConfigField 'String', 'DEV_HOST', "null"
}
}
BuildConfig.java ( ):
public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String APPLICATION_ID = "....";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "bundled";
public static final int VERSION_CODE = ...;
public static final String VERSION_NAME = ...;
public static final boolean BUNDLED = true;
}
RN bundle.js
, RN :
boolean bundled = BuildConfig.BUNDLED;
mReactInstanceManager = ReactInstanceManager.builder()
.setApplication(getApplication())
.setBundleAssetName("bundle.js")
.setJSMainModuleName("index.android")
.setJSBundleFile(bundled ? "assets://bundle.js" : null)
.addPackage(new MainReactPackage(false))
.addPackage(mInnerItemReactPackage)
.setUseDeveloperSupport(bundled ? false : ConfigSupplier.isDebuggable())
.setInitialLifecycleState(LifecycleState.RESUMED)
.build();
APK
I select the correct build option on the Build Variants screen:

And then continue, as usual, by clicking "Build → Build AIC."
I could add a more detailed blog post later.
source
share