masked-view
masked-view copied to clipboard
Apk release crash on Android 4.4.4 real device when launching
Bug
I release the production of my apk, and when i try to open it, it crash. I check my logs in adb if found this:
E/dalvikvm(31836): Could not find class 'org.reactnative.maskedview.RNCMaskedViewPackage', referenced from method com.facebook.react.PackageList.getPackages
E/AndroidRuntime(31836): FATAL EXCEPTION: main
E/AndroidRuntime(31836): Process: com.redapp, PID: 31836
E/AndroidRuntime(31836): java.lang.NoClassDefFoundError: org.reactnative.maskedview.RNCMaskedViewPackage
E/AndroidRuntime(31836): at com.facebook.react.PackageList.getPackages(PackageList.java:100)
E/AndroidRuntime(31836): at com.redapp.MainApplication$1.getPackages(MainApplication.java:26)
E/AndroidRuntime(31836): at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:76)
E/AndroidRuntime(31836): at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:38)
E/AndroidRuntime(31836): at com.facebook.react.ReactDelegate.loadApp(ReactDelegate.java:103)
E/AndroidRuntime(31836): at com.facebook.react.ReactActivityDelegate.loadApp(ReactActivityDelegate.java:88)
E/AndroidRuntime(31836): at com.facebook.react.ReactActivityDelegate.onCreate(ReactActivityDelegate.java:83)
E/AndroidRuntime(31836): at com.facebook.react.ReactActivity.onCreate(ReactActivity.java:44)
E/AndroidRuntime(31836): at android.app.Activity.performCreate(Activity.java:5447)
E/AndroidRuntime(31836): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
E/AndroidRuntime(31836): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
E/AndroidRuntime(31836): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
E/AndroidRuntime(31836): at android.app.ActivityThread.access$800(ActivityThread.java:166)
E/AndroidRuntime(31836): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
E/AndroidRuntime(31836): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(31836): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(31836): at android.app.ActivityThread.main(ActivityThread.java:5590)
E/AndroidRuntime(31836): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(31836): at java.lang.reflect.Method.invoke(Method.java:515)
268)
E/AndroidRuntime(31836): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
E/AndroidRuntime(31836): at dalvik.system.NativeStart.main(Native Method)
E/android.os.Debug( 597): !@Dumpstate > sdumpstate -k -t -z -d -m 31836 -o /data/log/dumpstate_app_error
E/WindowManager( 597): Starting window AppWindowToken{42e3b5f8 token=Token{432e6e20 ActivityRecord{433179f0 u0 com.redapp/.MainActivity t33}}} timed out
Environment info
react-native info output:
System:
OS: Windows 10 10.0.18362
CPU: (4) x64 Intel(R) Xeon(R) CPU W3530 @ 2.80GHz
Memory: 720.66 MB / 6.00 GB
Binaries:
Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.21.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 19, 26, 28, 29
Build Tools: 28.0.3, 29.0.0, 29.0.2
System Images: android-26 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5522156
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.61.5 => 0.61.5
Library version: 0.1.7
Steps To Reproduce
...
Describe what you expected to happen:
- I create the release version of my apk by using
./gradlew app:assembleRelease - I install it in my device "Samsung galaxy Tab E"
- It show an alert tell me that the app it stopped
Reproducible sample code
I don't use the plugin, but it seems that react-navigation use it
There is my package.json
{
"name": "myapp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
},
"dependencies": {
"@expo/vector-icons": "^10.0.6",
"@react-native-community/async-storage": "^1.7.1",
"@react-native-community/datetimepicker": "2.2.2",
"@react-native-community/masked-view": "^0.1.7",
"@react-native-community/netinfo": "^5.3.2",
"axios": "^0.19.1",
"constate": "^1.3.2",
"formik": "^2.1.1",
"haversine": "^1.1.1",
"lodash": "^4.17.15",
"moment": "^2.24.0",
"path": "^0.12.7",
"query-string": "^6.9.0",
"react": "16.8.6",
"react-native": "0.61.5",
"react-native-android-location-enabler": "^1.2.1",
"react-native-camera": "git+https://[email protected]/react-native-community/react-native-camera.git",
"react-native-datepicker": "^1.7.2",
"react-native-dropdownalert": "4.2.0",
"react-native-elements": "^1.2.7",
"react-native-geolocation-service": "^4.0.0",
"react-native-gesture-handler": "^1.5.3",
"react-native-get-imei": "^1.0.1",
"react-native-image-picker": "^2.3.1",
"react-native-imei": "^0.2.0",
"react-native-linear-gradient": "^2.5.6",
"react-native-maps": "^0.26.1",
"react-native-permissions": "^2.0.10",
"react-native-picker-select": "^6.5.1",
"react-native-qrcode-scanner": "^1.4.0",
"react-native-reanimated": "^1.4.0",
"react-native-responsive-ui": "^2.1.1",
"react-native-safe-area-context": "^0.6.2",
"react-native-safe-area-view": "^1.0.0",
"react-native-screens": "^2.0.0-alpha.22",
"react-native-spinkit": "^1.5.0",
"react-native-svg": "^10.0.0",
"react-native-tab-view": "^2.11.0",
"react-native-table-component": "^1.2.1",
"react-native-unimodules": "^0.7.0",
"react-native-vector-icons": "^6.6.0",
"react-navigation": "^4.0.10",
"react-navigation-drawer": "^2.3.3",
"react-navigation-stack": "^2.0.6",
"yup": "^0.28.0"
},
"devDependencies": {
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"babel-plugin-module-resolver": "^4.0.0",
"eslint": "^6.5.1",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-import-resolver-typescript": "^2.0.0",
"eslint-plugin-flowtype": "^4.5.3",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^2.3.0",
"eslint-plugin-react-native": "^3.8.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.4",
"react-native-typescript-transformer": "^1.2.13",
"react-test-renderer": "16.9.0",
"typescript": "^3.7.4"
},
"jest": {
"preset": "react-native"
}
}
Thanks
For me, it was an issue in Android MultiDex Configuration, not something related to this package. When configuring Multidex we have to do some additional steps for API level 20 or lower.
For a complete guide visit Offlicial doc on enabling multidex.
@yl-flyer how do you resolve this problem?