Skip to content Skip to sidebar Skip to footer

React Native 0.60 - Unable To Run App With React-native Run-android: Java.lang.noclassdeffounderror

It's late on Friday before a long weekend, and I'm having issues running an react-native app. Current version is 0.60 (latest), and running the command react-native run-android Re

Solution 1:

Solution is to use the new bundle/build process for Android .aab and .apk files, as shown on React Native documentation. Current process that is throwing errors is as follows:

cd android
./gradlew clean
cd ..
bundleAPK (`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/`)
buildReleaseAPK (`cd ./android && ./gradlew assembleRelease && cd ..`
installReleaseAPKAlt (`adb install -r ./android/app/build/outputs/apk/release/app-release.apk`)

When successful, this generates the .apk file and installs it on device, similar to downloading/installing directly from the Play Store. Various bugs in build process are preventing this, as detailed above.

React Native documentation suggest to use a different set of commands to generate .aab file, and from that the .apk:

cd android
./gradlew clean
./gradlew bundleRelease
cd .. && react-native run-android --variant=release

Complete details can be found at https://facebook.github.io/react-native/docs/signed-apk-android#generating-the-release-apk. Information about generating Signed APK included since previous implementation.

Using this approach, .aab and .apk files are generated and installed on device, but another issue arises in lack of ic_launcher_rounded. See React Native 0.60 - ic_launcher_round missing for Release Bundle/Build for details. Marking question as closed when allowed.

Post a Comment for "React Native 0.60 - Unable To Run App With React-native Run-android: Java.lang.noclassdeffounderror"