mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Updated AGP, trying to fix crash due to disabled crashlytics with latest changes
This commit is contained in:
parent
a9d11543d8
commit
5ebb4ee6ac
4 changed files with 20 additions and 22 deletions
|
|
@ -18,6 +18,7 @@ job-android:
|
|||
- echo keyAlias=$ANDROID_KEYSTORE_KEY_ALIAS >> keystore.properties
|
||||
- echo storeFile=$ANDROID_KEYSTORE_FILE >> keystore.properties
|
||||
- ./gradlew app:dependencies | grep org.linphone
|
||||
- ./gradlew clean
|
||||
- ./gradlew assembleDebug
|
||||
- ./gradlew assembleRelease
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import com.android.build.gradle.internal.tasks.factory.dependsOn
|
||||
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
|
||||
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsPlugin
|
||||
import com.google.gms.googleservices.GoogleServicesPlugin
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.FileInputStream
|
||||
|
|
@ -12,8 +11,7 @@ plugins {
|
|||
alias(libs.plugins.ktlint)
|
||||
alias(libs.plugins.jetbrainsKotlinAndroid)
|
||||
alias(libs.plugins.navigation)
|
||||
alias(libs.plugins.googleGmsServices) apply false
|
||||
alias(libs.plugins.crashlytics) apply false
|
||||
alias(libs.plugins.crashlytics)
|
||||
}
|
||||
|
||||
val packageName = "org.linphone"
|
||||
|
|
@ -32,12 +30,6 @@ if (firebaseCloudMessagingAvailable) {
|
|||
} else {
|
||||
println("google-services.json not found, disabling CloudMessaging feature")
|
||||
}
|
||||
if (crashlyticsAvailable) {
|
||||
println("google-services.json, libs & libs-debug found, enabling Crashlytics feature")
|
||||
apply<CrashlyticsPlugin>()
|
||||
} else {
|
||||
println("google-services.json, libs & libs-debug not found, disabling Crashlytics feature")
|
||||
}
|
||||
|
||||
var gitBranch = ByteArrayOutputStream()
|
||||
var gitVersion = "6.0.0"
|
||||
|
|
@ -163,14 +155,13 @@ android {
|
|||
resValue("string", "linphone_app_branch", gitBranch.toString().trim())
|
||||
|
||||
if (crashlyticsAvailable) {
|
||||
val path = File("$sdkPath/libs-debug/").toString()
|
||||
configure<CrashlyticsExtension> {
|
||||
nativeSymbolUploadEnabled = true
|
||||
unstrippedNativeLibsDir = File("$sdkPath/libs-debug/").toString()
|
||||
unstrippedNativeLibsDir = path
|
||||
}
|
||||
resValue("bool", "crashlytics_enabled", "true")
|
||||
} else {
|
||||
resValue("bool", "crashlytics_enabled", "false")
|
||||
}
|
||||
buildConfigField("Boolean", "CRASHLYTICS_ENABLED", crashlyticsAvailable.toString())
|
||||
}
|
||||
|
||||
getByName("release") {
|
||||
|
|
@ -186,14 +177,13 @@ android {
|
|||
resValue("string", "linphone_app_branch", gitBranch.toString().trim())
|
||||
|
||||
if (crashlyticsAvailable) {
|
||||
val path = File("$sdkPath/libs-debug/").toString()
|
||||
configure<CrashlyticsExtension> {
|
||||
nativeSymbolUploadEnabled = true
|
||||
unstrippedNativeLibsDir = File("$sdkPath/libs-debug/").toString()
|
||||
unstrippedNativeLibsDir = path
|
||||
}
|
||||
resValue("bool", "crashlytics_enabled", "true")
|
||||
} else {
|
||||
resValue("bool", "crashlytics_enabled", "false")
|
||||
}
|
||||
buildConfigField("Boolean", "CRASHLYTICS_ENABLED", crashlyticsAvailable.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -375,9 +375,16 @@ class CoreContext @UiThread constructor(val context: Context) : HandlerThread("C
|
|||
Log.i("$TAG Creating Core")
|
||||
Looper.prepare()
|
||||
|
||||
if (context.resources.getBoolean(org.linphone.R.bool.crashlytics_enabled)) {
|
||||
Factory.instance().loggingService.addListener(loggingServiceListener)
|
||||
Log.i("$TAG Crashlytics enabled, register logging service listener")
|
||||
if (BuildConfig.CRASHLYTICS_ENABLED) {
|
||||
Log.i("$TAG Crashlytics is enabled, registering logging service listener")
|
||||
try {
|
||||
FirebaseCrashlytics.getInstance()
|
||||
Factory.instance().loggingService.addListener(loggingServiceListener)
|
||||
} catch (e: Exception) {
|
||||
Log.e("$TAG Failed to instantiate Crashlytics: $e")
|
||||
}
|
||||
} else {
|
||||
Log.i("$TAG Crashlytics is disabled")
|
||||
}
|
||||
Log.i("=========================================")
|
||||
Log.i("==== Linphone-android information dump ====")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[versions]
|
||||
agp = "8.5.2"
|
||||
kotlin = "1.9.23"
|
||||
agp = "8.6.1"
|
||||
kotlin = "2.0.20"
|
||||
gmsGoogleServices = "4.4.2"
|
||||
firebaseCrashlytics = "3.0.2"
|
||||
firebaseBomVersion = "33.3.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue