Closed renchap closed 2 years ago
@renchap thanks, I'm checking it now.
@renchap I cannot reproduce it, I've tried on Android 5, 6, 7, and 8. Can you share the SDK init code snippet? And if possible a minimal reproduction example as well, thanks.
The init is quite simple:
Sentry.init({
dsn: "https://key@sentry.domain.tld/6",
environment: getEnvironment(),
tracesSampleRate: 1,
integrations: [
new Sentry.ReactNativeTracing({
routingInstrumentation: sentryRoutingInstrumentation,
tracingOrigins: [
"localhost",
/.*\.notos.co\//,
],
}),
],
})
I will try to provide a repro.
@renchap yes please, meanwhile enable the debug: true
and copy-paste the logs, maybe there are hints, thanks.
Here are the logs with debug: true
, but I dont see anything really useful :(
@renchap it's likely something in your environment I guess, but I can't say what by the logs either. A minimal reproduction example would help.
I am using Java 18 (openjdk version "18.0.1.1" 2022-04-22
) to build the app, can this be related?
My build is configured as follows:
buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
supportLibVersion = "28.0.0"
googlePlayServicesAuthVersion = "19.2.0"
kotlinVersion = "1.6.10"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:4.1.2")
classpath("com.google.gms:google-services:4.3.10")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
JDK 18 supports building the app on an M1 mac and everything works fine with it, but as the error is about a java language feature (java.lang.String java.lang.Object.toString
) I am wondering if this could come from the JDK version.
Ok this is it! I just built my app using openjdk 17 and it worked fine on Android 7.
Something changed between JDK 17 and JDK 18 and it breaks the support on Android API 26 and lower.
JDK 18 is not yet recommended for React Native (I saw various posts reporting issues with it), so I will force my build to use JDK 17 for now.
I leave the issue open if you want to have a further look at it, but feel free to close it if this is not something you want to fix for now.
Gotcha, this is likely not on our end since Android itself supports Android 7-11 only as of the first class. Even Java 11 bytecode is in alpha https://developer.android.com/studio/preview/features#jvm-11-bytecode and https://developer.android.com/studio/releases/gradle-plugin#java-11 So I'd close it, thanks for checking it out.
Environment
How do you use Sentry? Self-hosted, 22.6.0
Which SDK and version?
@sentry/react-native
: 4.1.0react-native
: 0.68.2Steps to Reproduce
Expected Result
The app launches properly.
Actual Result
It crashes with the following error:
When starting the app without calling
Sentry.init
, the app works fine. On Android 9 (API 27) and higher, the app works fine.