Checklist before submitting a bug report
Java version
17
Android version
Android 11
Android SDK version
18.0.0
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
fix crash
Expected results
Using the official standard API to check if the feature is supported.
androidorAndroidx-Privacy Sandbox
Actual results
Incorrect use of the MeasurementManager API on Android 11 resulted in a crash.
|
private fun canRegisterTrigger(): Boolean { |
|
if (!enabled) { |
|
return false |
|
} |
|
|
|
try { |
|
Class.forName("android.adservices.measurement.MeasurementManager") |
|
return true |
|
} catch (e: Exception) { |
|
Log.i(TAG, "FAILURE_NO_MEASUREMENT_MANAGER_CLASS") |
|
gpsDebugLogger.log( |
|
Constants.GPS_ARA_FAILED, |
|
Bundle().apply { putString(Constants.GPS_ARA_FAILED_REASON, e.toString()) }) |
|
return false |
|
} catch (e: Error) { |
|
Log.i(TAG, "FAILURE_NO_MEASUREMENT_MANAGER_CLASS") |
|
gpsDebugLogger.log( |
|
Constants.GPS_ARA_FAILED, |
|
Bundle().apply { putString(Constants.GPS_ARA_FAILED_REASON, e.toString()) }) |
|
return false |
|
} |
|
} |
Find the crash by the name of the crashing thread and determine that the crash was triggered by the Facebook SDK
|
measurementManager.registerTrigger( |
|
attributionTriggerUri, FacebookSdk.getExecutor(), outcomeReceiver |
|
) |
gradle-8.11.1
Android gradle plugin 8.10.0
minSdkVersion 23
android {
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
}
Checklist before submitting a bug report
Java version
17
Android version
Android 11
Android SDK version
18.0.0
Installation platform & version
Gradle
Package
Core & AppEvents
Goals
fix crash
Expected results
Using the official standard API to check if the feature is supported.
androidorAndroidx-Privacy Sandbox
Actual results
Incorrect use of the MeasurementManager API on Android 11 resulted in a crash.
facebook-android-sdk/facebook-core/src/main/java/com/facebook/appevents/gps/ara/GpsAraTriggersManager.kt
Lines 123 to 144 in 11f8a1e
Find the crash by the name of the crashing thread and determine that the crash was triggered by the Facebook SDK
facebook-android-sdk/facebook-core/src/main/java/com/facebook/appevents/gps/ara/GpsAraTriggersManager.kt
Lines 107 to 109 in 11f8a1e
gradle-8.11.1
Android gradle plugin 8.10.0
minSdkVersion 23