Comments (15)
Turns out it's a problem with multiple dex. I forgot to add the following attachBaseContext
override code:
public class MyApplication extends SomeOtherApplication {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(context);
Multidex.install(this);
}
}
https://developer.android.com/studio/build/multidex.html#mdex-gradle
from instabug-react-native.
Thank you @SudoPlz for sending this over.
The team is looking into.
I will keep you posted.
from instabug-react-native.
More info:
That's on a Google Nexus S on Android 4.1.1 API 16,
I tried running the same code on a Google Nexus 5x on Android 8.0.0 and I didn't receive a crash.
from instabug-react-native.
@SudoPlz Thank you for the valuable information.
from instabug-react-native.
https://github.com/Instabug/instabug-reactnative/commits/customBuild/fix_no_class_def_crash fixed the issue above, but I know get this error:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: rx.subjects.PublishSubject
at com.instabug.library.core.eventbus.a.<init>(EventBus.java:16)
at com.instabug.library.core.eventbus.b.<init>(SessionStateEventBus.java:5)
at com.instabug.library.core.eventbus.b.a(SessionStateEventBus.java:11)
at com.instabug.library.invocation.b.m(InvocationManager.java:511)
at com.instabug.library.invocation.b.<init>(InvocationManager.java:75)
at com.instabug.library.invocation.b.a(InvocationManager.java:81)
at com.instabug.library.f.t(InstabugDelegate.java:244)
at com.instabug.library.f.b(InstabugDelegate.java:190)
at com.instabug.library.f.a(InstabugDelegate.java:171)
at com.instabug.library.Instabug$Builder.build(Instabug.java:2382)
at com.instabug.library.Instabug$Builder.build(Instabug.java:2431)
at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:59)
at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:69)
at com.acuityscheduling.app.android.MainApplication.createAdditionalReactPackages(MainApplication.java:83)
at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.getPackages(NavigationReactGateway.java:132)
at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:74)
at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.createReactInstanceManager(NavigationReactGateway.java:155)
at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:41)
at com.reactnativenavigation.react.NavigationReactGateway.getReactInstanceManager(NavigationReactGateway.java:59)
at com.reactnativenavigation.react.NavigationReactGateway.hasStartedCreatingContext(NavigationReactGateway.java:46)
at com.reactnativenavigation.controllers.SplashActivity.onResume(SplashActivity.java:28)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
at android.app.Activity.performResume(Activity.java:5082)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2565)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2603)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2089)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
I believe it's easy to reproduce, all you have to do is start a Genymotion vm and fire up a Google Nexus S - 4.1.1 - API 16 480x800
device with 1 Processor, and 512MB base memory and you should be able to reproduce this.
from instabug-react-native.
@SudoPlz I will check this and get back to you 😊
from instabug-react-native.
@SudoPlz We have tried the same configurations and steps that you mentioned. However, we failed to reproduce the same crash.
Are you able to reproduce it on a real device or on the emulator?
from instabug-react-native.
Ι'll try tomorrow and I'll post back @NadineMansour :)
from instabug-react-native.
@SudoPlz Did you get a chance to try it?
from instabug-react-native.
I did @NadineMansour, I get the same errror on a Nexus S API 16 emulator.
Here are the emulator details:
from instabug-react-native.
@SudoPlz Thank you for the details.
We will look into it.
I will keep you updated.
from instabug-react-native.
Same issue.
11-17 10:34:22.370 20264 20264 E AndroidRuntime: FATAL EXCEPTION: main
11-17 10:34:22.370 20264 20264 E AndroidRuntime: Process: com.riskstorm.riskstorm, PID: 20264
11-17 10:34:22.370 20264 20264 E AndroidRuntime: java.lang.NoClassDefFoundError: com.instabug.library.analytics.AnalyticsObserver$1
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.instabug.library.analytics.AnalyticsObserver.<init>(AnalyticsObserver.java:46)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.instabug.library.analytics.AnalyticsObserver.getInstance(AnalyticsObserver.java:58)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.instabug.library.Instabug$Builder.setInvocationEvent(Instabug.java:1711)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:57)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.instabug.reactlibrary.RNInstabugReactnativePackage.<init>(RNInstabugReactnativePackage.java:69)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.riskstorm.riskstorm.MainApplication.createAdditionalReactPackages(MainApplication.java:42)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.getPackages(NavigationReactGateway.java:132)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.facebook.react.ReactNativeHost.createReactInstanceManager(ReactNativeHost.java:76)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.reactnativenavigation.react.NavigationReactGateway$ReactNativeHostImpl.createReactInstanceManager(NavigationReactGateway.java:155)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.facebook.react.ReactNativeHost.getReactInstanceManager(ReactNativeHost.java:42)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.reactnativenavigation.react.NavigationReactGateway.getReactInstanceManager(NavigationReactGateway.java:59)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.reactnativenavigation.react.NavigationReactGateway.hasStartedCreatingContext(NavigationReactGateway.java:46)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.reactnativenavigation.controllers.SplashActivity.onResume(SplashActivity.java:42)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.Activity.performResume(Activity.java:5317)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2787)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2825)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2252)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:139)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5028)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
11-17 10:34:22.370 20264 20264 E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
from instabug-react-native.
Oh my God @messense you're a beast man, that fixed it..!!! Ok I literally have NO idea why that worked, would you mind explaining?
@NadineMansour I no longer get a crash after adding @messense 's suggestion to my code.
Also the code I added is:
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
if (android.os.Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {
// only for KITKAT_WATCH and newer versions
MultiDex.install(this);
}
}
because MultiDex.install
is available only from API 21 and below (if I'm not mistaken).
Plus for the people reading this in the future, make sure you also add
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
in your /android/app/build.gradle
.
from instabug-react-native.
I am really glad that everything is working now 🎉
@SudoPlz @messense Thank you so much for your awesome contribution!
from instabug-react-native.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from instabug-react-native.
Related Issues (20)
- Error when using react-native-version HOT 1
- NetworkLogger.setNetworkDataObfuscationHandler not working as expected in iOS (React Native) HOT 8
- Is there any way handle the Beta Welcome Message , like is there any handler for the 'done' button. To do action after clicking on this button HOT 4
- iOS build failing in release mode HOT 4
- Custom fingerprint HOT 8
- Customise strings on Survey Welcome Screen HOT 6
- setFloatingButtonEdge is working not correctly on Android HOT 1
- PhaseScriptExecution [CP-User] HOT 7
- Instabug crashes when init is called in background (Android) HOT 2
- upload_sourcemap.sh: No such file or directory HOT 1
- [Android] Caused by java.lang.IllegalStateException Expected Android API level 21+ but was 33 HOT 1
- Wrong Dutch translations for Android HOT 4
- instabug init not working HOT 2
- Unable to find source map file at: /Users/runner/work/1/s/ios/main.jsbundle.map' HOT 3
- Latest version Instabug plugin getting error PhaseScriptExecution nonzero exit code in Release build iOS HOT 7
- [Android] Cannot add task 'uploadSourcemaps' as a task with that name already exists. HOT 10
- [BUG] this.upload.addEventListener is not a function HOT 2
- [iOS] JS crashes are reported as Native Exception instead of JS Exception HOT 1
- Network logs have a response body as string not a JSON HOT 5
- Jacoco breaks on react native 0.72 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instabug-react-native.