Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Didn't find class io.sentry.android.core.AppStateStart #3497

Closed
thebigredgeek opened this issue Jan 5, 2024 · 9 comments
Closed

Didn't find class io.sentry.android.core.AppStateStart #3497

thebigredgeek opened this issue Jan 5, 2024 · 9 comments

Comments

@thebigredgeek
Copy link

Getting this error after upgrading to @sentry/react-native 5.15.2. We are manually initializing the SDK from native code, rather than javascript, to catch app start crashes.

I can't seem to find a reference to this class in this library or in the sentry-java library.

Any help would be appreciated!!!

@thebigredgeek
Copy link
Author

Screenshot 2024-01-05 at 10 25 46 AM

@facugaich
Copy link

Hi,

This is because the class was removed in sentry-android 7.1.0, therefore sentry-react-native is not compatible with that version. If you disable the Android SDK autoInstallation you should get the React native SDK compatible version, like this:

apply plugin: "io.sentry.android.gradle"

sentry {
    autoInstallation {
      enabled = false
    }
}

@ sentry team, I think the docs for Manual Setup could be a more explicit on this point. The suggestion to disable autoInstallation is buried in the comment of a code snippet that is introduced as an example ("You can configure the plugin options..."), when it should probably be a required step for the default manual setup.

@focux
Copy link

focux commented Jan 8, 2024

I'm experiencing the same issue and after trying @facugaich workaround it is still crashing for me.

Sentry version:
"@sentry/react-native": "^5.15.1",

Error when using @facugaich's workaround:
E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "io.sentry.android.core.performance.AppStartMetrics" on path: DexPathList[[zip file "/data/app/~~Aq42l8egZdmLm1xm1OqvkQ==/com.[redacted]-DxwOzqcVtxUmmNTZvby0Cw==/base.apk"],nativeLibraryDirectories=[/data/app/~~Aq42l8egZdmLm1xm1OqvkQ==/com.[redacted]-DxwOzqcVtxUmmNTZvby0Cw==/lib/arm64, /data/app/~~Aq42l8egZdmLm1xm1OqvkQ==/com.[redacted]-DxwOzqcVtxUmmNTZvby0Cw==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
Error without workaround: image

EDIT:

Downgrading the android plugin from 4.1.1 to 3.11.1, fixed it.

- classpath("io.sentry:sentry-android-gradle-plugin:4.1.1")
+ classpath("io.sentry:sentry-android-gradle-plugin:3.11.1")

@kahest
Copy link
Member

kahest commented Jan 9, 2024

Hey all, thanks for reporting this and the helpful details and workarounds 🙏 we'll investigate and follow up here

@krystofwoldrich
Copy link
Member

Thank you @facugaich and @focux for sharing your workarounds.

For anyone new reading this issue, here is a summary of what to do:

  1. Use the latest Sentry Android Gradle Plugin compatible with sentry-android@6, currently 3.11.1. Add the following to android/build.gradle.
buildscript {
    // ...
    dependencies {
        classpath("io.sentry:sentry-android-gradle-plugin:3.11.1")
    }
}
  1. Ensure the Sentry Android Gradle Plugin autoInstall feature is disabled, check android/app/build.gradle:
apply plugin: "io.sentry.android.gradle"

sentry {
    autoInstallation {
      enabled = false
    }
}

We will close this issue since the RN SDK shipped bundled with a compatible sentry-android version. We will post an update when the RN SDK release with sentry-android@7 is available.

@krystofwoldrich krystofwoldrich closed this as not planned Won't fix, can't repro, duplicate, stale Jan 12, 2024
@vipulrawat
Copy link

Now that sentry-android@7 is released, upgrading to 7.0.0 manually has fixed this issue. Would be nice to have a follow-up sentry-react-native release.

@guilhermeadsferreira
Copy link

I couldn't deactivate autoInstallation, is there any forecast for a new release with this fix?

@krystofwoldrich
Copy link
Member

@vipulrawat Sentry React Native will include the v7 soon.

@guilhermeadsferreira Could you elaborate on why you can't disable the autoInstall?

@Botsy
Copy link

Botsy commented Feb 13, 2024

@krystofwoldrich Is there a way to disable the autoInstallation for Expo projects? Our app is crashing and we cannot seem to disable it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

8 participants