android - React Native Release: Could not connect to development server -
i followed official guide create installable android application.
however when installing apk ./gradlew installrelease
app crashes react fragment loaded:
runtimeexception: not connect development server.
my fragment code looks this, integration android tutorial suggests.
@override public view oncreateview(layoutinflater inflater, @nullable viewgroup container, bundle savedinstancestate) { mreactinstancemanager = reactinstancemanager.builder() .setapplication(getactivity().getapplication()) .setbundleassetname("index.android.bundle") .setjsmainmodulename("index.android") .addpackage(new mainreactpackage()) .setusedevelopersupport(false) // changes nothing .setinitiallifecyclestate(lifecyclestate.resumed) .build(); mreactrootview.startreactapplication(mreactinstancemanager, "helloworld", null); return mreactrootview; }
do have ideas might wrong? react native need development server if app packaged release? can`t believe that.. want app running is.
as @rmevans9 mentioned in comments above, need not have development server release or development mode (you using offline bundling capability then).
one interesting point mentioned in code:
.setusedevelopersupport(false) // changes nothing
if set true, app work connecting local server? if not, guess react application using isn't registered "helloworld" using in app invocation.
mreactrootview.startreactapplication(mreactinstancemanager, "helloworld", null);
make sure name matches registered in react native app.
Comments
Post a Comment