Closed import-yuv closed 1 year ago
Hi, thank you for the message and the log.
Can you share what version of Sentry Android Gradle Plugin are you using and how your setup looks like compared to https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#enable-sentry-agp?
Hi @krystofwoldrich , Thanks for your quick reply.
Please see, Here is the setup:
Android/build.gradle
buildscript {
ext {
buildToolsVersion = "33.0.0"
minSdkVersion = 23
compileSdkVersion = 33
targetSdkVersion = 33
ndkVersion = "23.1.7779620"
kotlinVersion = '1.6.0'
}
ext.detoxKotlinVersion = ext.kotlinVersion
repositories {
maven {
url "$rootDir/../node_modules/react-native/android"
}
google()
mavenCentral()
mavenLocal()
}
dependencies {
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
classpath 'com.google.firebase:perf-plugin:1.4.1'
classpath 'io.sentry:sentry-android-gradle-plugin:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Android/app/build.gradle
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply plugin: 'com.google.gms.google-services'
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'com.google.firebase.firebase-perf'
/**
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}
project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
if(System.getenv("SENTRY_UPLOAD") == "true") {
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
apply plugin: 'io.sentry.android.gradle'
}
/**
* Set this to true to Run Proguard on Release builds to minify the Java bytecode
*/
def enableProguardInReleaseBuilds = true
/**
* The preferred build flavor of JavaScriptCore (JSC).
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
def safeExtGet(name) {
rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties[name]
}
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.xxx.xxx"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 100
versionName "1.0.0"
multiDexEnabled true
resValue 'string', "CODE_PUSH_APK_BUILD_TIME", String.format("\"%d\"", System.currentTimeMillis())
}
signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// for refiner-react-native package integration
buildFeatures {
dataBinding = true
}
}
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation "com.android.support:multidex:2.0.1"
implementation 'com.google.android.gms:play-services-base:17.6.0'
implementation 'com.google.firebase:firebase-messaging:21.0.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
implementation "com.google.android.play:core:${safeExtGet('playCoreVersion')}" //Added for In App Rating
implementation "com.google.android.gms:play-services-base:${safeExtGet('playServicesVersion')}" // For google-play services
implementation "com.google.android.gms:play-services-auth:20.2.0" //For Phone number hints API
implementation 'com.google.firebase:firebase-perf:20.1.0'
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Hi,
thank you for the message with extra details. It looks like you are using SAGP 3.1.2
, I believe the issue you have was fixed in https://github.com/getsentry/sentry-android-gradle-plugin/pull/431.
Can you upgrade to the latest version of the plugin? And let us know if it solved the issue.
Hi @krystofwoldrich ,
Thank you for your response. I've upgraded SAGP to version 3.12.0, and I'm happy to report that everything is working perfectly now. The issue has indeed been resolved.
Thanks again for your assistance!
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)SDK version: 5.6.0
react-native
version: 0.72.3Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
[Link to issue]
Configuration:
(
@sentry/react-native
)or
(
react-native-sentry
)I have following issue:
When I upgraded react native from version 0.71.11 to version 0.72.3, I saw this issue. Getting the following logs in circle ci at the fastlane android android_assemble step: