-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
Checklist before submitting a bug report
- I've updated to the latest released version of the SDK
- I've searched for existing Github issues
- I've looked for existing answers on Stack Overflow, the Facebook Developer Community Forum and the Facebook Developers Group
- I've read the Code of Conduct
- This issue is not security related and can safely be disclosed publicly on GitHub
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.
Lines 123 to 144 in 11f8a1e
| 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
Lines 107 to 109 in 11f8a1e
| 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'
}Reactions are currently unavailable