I get the following error message when running react-native run-android:
But I have the following dependencies:
compileSdkVersion 25
buildToolsVersion "25.0.2"
The output for "sdkmanager --list" is as follows:
Installed packages:
Path | Version | Description | Location
------- | ------- | ------- | -------
build-tools;23.0.1 | 23.0.1 | Android SDK Build-Tools 23.0.1 | build-tools/23.0.1/
build-tools;23.0.3 | 23.0.3 | Android SDK Build-Tools 23.0.3 | build-tools/23.0.3/
build-tools;25.0.0 | 25.0.0 | Android SDK Build-Tools 25 | build-tools/25.0.0/
build-tools;25.0.1 | 25.0.1 | Android SDK Build-Tools 25.0.1 | build-tools/25.0.1/
build-tools;25.0.2 | 25.0.2 | Android SDK Build-Tools 25.0.2 | build-tools/25.0.2/
build-tools;26.0.1 | 26.0.1 | Android SDK Build-Tools 26.0.1 | build-tools/26.0.1/
emulator | 26.1.2 | Android Emulator | emulator/
extras;android;m2repository | 47.0.0 | Android Support Repository | extras/android/m2repository/
extras;google;m2repository | 56 | Google Repository | extras/google/m2repository/
extras;intel;Ha...ecution_Manager | 6.1.1 | Intel x86 Emulator Accelerator... | extras/intel/Ha...cution_Manager/
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4/
platform-tools | 26.0.0 | Android SDK Platform-Tools | platform-tools/
platforms;android-23 | 2 | Android SDK Platform 23, rev 2 | platforms/android-23/
platforms;android-25 | 3 | Android SDK Platform 25 | platforms/android-25/
platforms;android-26 | 2 | Android SDK Platform 26 | platforms/android-26/
system-images;a...google_apis;x86 | 4 | Google APIs Intel x86 Atom Sys... | system-images/a...oogle_apis/x86/
tools | 26.0.2 | Android SDK Tools | tools/
Are you using the latest version of react-native-sentry?
As you can see we use 23.0.1
https://github.com/getsentry/react-native-sentry/blob/master/android/build.gradle
My version of react-native-sentry was "0.12.9".
I used the command "yarn upgrade react-native-sentry" to update it to the latest version i.e. "0.14.11".
Nevertheless, I'm getting the same error.
Can you open the build.gradle file of react-native-sentry in node_modules locally and check the version please?
This is what I have in "node_modules/react-native-sentry/android/build.gradle":
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.1'
defaultConfig {
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
lintOptions {
warning 'InvalidPackage'
}
}
dependencies {
compile 'com.facebook.react:react-native:+'
compile 'io.sentry:sentry-android:1.2.0'
}
Now, the compileSdkVersion and the buildToolsVersion in "node_modules/react-native-sentry/android/build.gradle" differ from those of "android/app/build.gradle": 25 and 25.0.2 vs 23 and 23.0.1.
Is that a conflict?
I'm not the Android pro tbh but I guess so.
Try setting your projects to build tools to 23 as well since react-native itself is still using 23.
I did the opposite and changed compileSdkVersion and buildToolsVersion to how it was in "android/app/build.gradle."
It resolved the error, though I'm getting a new one (never ending react-native trouble! 馃槒)
Most helpful comment
I did the opposite and changed compileSdkVersion and buildToolsVersion to how it was in "android/app/build.gradle."
It resolved the error, though I'm getting a new one (never ending react-native trouble! 馃槒)