Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29438

React native can't debug while adding .aar file

$
0
0

I have a React Native ("react-native": "0.62.2", with androidx enabled) project with a simple Android Library .aar. All works fine in debug mode and release mode.

While adding a new .aar file to my React Native project, then the application can't be run in debug mode. I get this Logcat on Android studio

2020-05-15 09:30:02.389 15732-15854/com.awesomeproject E/unknown:ReactNative: Exception in native call    java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.        at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)        at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:235)        at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:29)        at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:259)        at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1243)        at com.facebook.react.ReactInstanceManager.access$1000(ReactInstanceManager.java:132)        at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:996)        at java.lang.Thread.run(Thread.java:764)

On device, I get the corresponding message Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.

However, in release mode

npx react-native run-android --variant=release

the application runs correctly without issues.

Also, the new .aar file works normally when integrated to a native Android application.

Any Ideas?


Viewing all articles
Browse latest Browse all 29438

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>