Git Product home page Git Product logo

Comments (15)

messense avatar messense commented on July 19, 2024 2

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.

NadineMansour avatar NadineMansour commented on July 19, 2024

Thank you @SudoPlz for sending this over.
The team is looking into.
I will keep you posted.

from instabug-react-native.

SudoPlz avatar SudoPlz commented on July 19, 2024

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.

NadineMansour avatar NadineMansour commented on July 19, 2024

@SudoPlz Thank you for the valuable information.

from instabug-react-native.

SudoPlz avatar SudoPlz commented on July 19, 2024

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.

NadineMansour avatar NadineMansour commented on July 19, 2024

@SudoPlz I will check this and get back to you 😊

from instabug-react-native.

NadineMansour avatar NadineMansour commented on July 19, 2024

@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.

SudoPlz avatar SudoPlz commented on July 19, 2024

Ι'll try tomorrow and I'll post back @NadineMansour :)

from instabug-react-native.

NadineMansour avatar NadineMansour commented on July 19, 2024

@SudoPlz Did you get a chance to try it?

from instabug-react-native.

SudoPlz avatar SudoPlz commented on July 19, 2024

I did @NadineMansour, I get the same errror on a Nexus S API 16 emulator.

Here are the emulator details:
screen shot 2017-11-15 at 14 41 53

from instabug-react-native.

NadineMansour avatar NadineMansour commented on July 19, 2024

@SudoPlz Thank you for the details.
We will look into it.
I will keep you updated.

from instabug-react-native.

messense avatar messense commented on July 19, 2024

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.

SudoPlz avatar SudoPlz commented on July 19, 2024

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.

NadineMansour avatar NadineMansour commented on July 19, 2024

I am really glad that everything is working now 🎉

@SudoPlz @messense Thank you so much for your awesome contribution!

from instabug-react-native.

lock avatar lock commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.