A coroutine dependency error occurs during the build process with the following message.
java.lang.NoClassDefFoundError: kotlin/coroutines/AbstractCoroutineContextKey
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
...
If the kotlinx-coroutines-core library version is 1.3.5 or later, the kotlin-stdlib library version must be at a certain level or later.
Check whether the kotlin-stdlib library version is v.1.3.70 or later with the gradlew dependencies
command. If the version is earlier than v.1.3.70, you need to update it.
Deeplink Open events that occur through the push notifications generated by the Braze SDK are not collected by Airbridge. Instead, the App Open event is collected.
The Airbridge Android SDK uses the dataString
in the action
and intent
of the Activity
to distinguish between Deeplink Open events and App Open events.
When a user opens the app through a push notification using the Braze SDK, the app goes through an activity called NotificationTrampolineActivity
. This activity handles push notifications, but the dataString
is not included in its action
and intent
, preventing the SDK from determining if it's a Deeplink Open event or an App Open event.
The problem can be solved using the code snippet below for Airbridge Android SDK versions v2.21.5 and later.
val option = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
.setLifecycleIntegration {
it.takeIf { it.javaClass.name == "com.braze.push.NotificationTrampolineActivity" }
?.run { intent?.extras?.getString("uri") }
}
.build()
Airbridge.initializeSDK(application, option)
AirbridgeOption option = new AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
.setLifecycleIntegration(new AirbridgeLifecycleIntegration() {
@Nullable
@Override
public String getDataString(@NonNull Activity activity) {
if (activity.getClass().getName().equals("com.braze.push.NotificationTrampolineActivity")
&& activity.getIntent() != null
&& activity.getIntent().getExtras() != null) {
return activity.getIntent().getExtras().getString("uri");
}
return null;
}
})
})
.build();
Airbridge.initializeSDK(application, option);
The "Manifest merger failed" error occurs during the build process.
The Airbridge SDK's AndroidManifest.xml
includes rules to opt out of backing up the Shared Preferences data. The purpose of this rule is to avoid retaining the same Airbridge settings during the reinstallation of the app so that new installs or reinstalls can be detected accurately.
Merging Airbridge SDK backup rules with your app backup rules can cause conflicts.
Below are the opt-out rules defined in the Airbridge SDK.
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</cloud-backup>
<device-transfer>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</device-transfer>
</data-extraction-rules>
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</full-backup-content>
Adding android:fullBackupContent="string"
to the AndroidManifest.xml
file may cause an error like the following.
Manifest merger failed : Attribute application@fullBackupContent value=(string) from AndroidManifest.xml
To fix this error,
add xmlns:tools="http://schemas.android.com/tools"
to the <manifest>
tag
add tools:replace="android:fullBackupContent"
to the <application>
tag
in the AndroidManifest.xml
file.
Adding android:dataExtractionRules="string resource"
to the AndroidManifest.xml
file may cause an error like the following.
Manifest merger failed : Attribute application@dataExtractionRules value=(string resource) from AndroidManifest.xml
To fix this error,
add xmlns:tools="http://schemas.android.com/tools"
to the <manifest>
tag
add tools:replace="android:dataExtractionRules"
to the <application>
tag
in the AndroidManifest.xml
file.
Adding android:allowBackup="false"
to the AndroidManifest.xml
file may cause an error like the following.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:32:9-36
is also present at [:airbridge] AndroidManifest.xml:27:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:30:5-250:19 to override.
To fix this error,
add xmlns:tools="http://schemas.android.com/tools"
to the <manifest>
tag
add tools:replace="android:allowBackup"
to the <application>
tag
in the AndroidManifest.xml
file.
The android:dataExtractionRules
has been added in API Level 31. Therefore, if the compileSdkVersion is lower than 31, an error like the following may occur.
AndroidManifest.xml: AAPT: error: attribute android:dataExtractionRules not found.
To fix this error,
add xmlns:tools="http://schemas.android.com/tools"
to the <manifest>
tag
add tools:remove="android:dataExtractionRules"
to the <application>
tag
in the AndroidManifest.xml
file.
For more guidance, refer to the articles below.
If an Airbridge SDK backup rule and a backup rule for a different third-party SDK (e.g., AppsFlyer SDK) overlap, you will see the build error below.
Attribute application@fullBackupContent value=(@xml/appsflyer_backup_rules) from [com.appsflyer:af-android-sdk:6.6.1] AndroidManifest.xml:14:18-73
is also present at [io.airbridge:sdk-android:2.14.0] AndroidManifest.xml:27:18-78 value=(@xml/airbridge_auto_backup_rules).
Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:7:5-13:19 to override.
Overlapping of the Airbridge SDK backup rules and third-party SDK backup rules can cause build errors.
Create a src/main/res/xml
folder.
Within the new xml folder, create a file (e.g., custom_backup_rules.xml
).
Add the data backup rules defined in the Airbridge SDK as follows.
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</full-backup-content>
Note
The data_extraction_rules.xml setting is required for Airbridge Android SDK v4.1.1 and above.
Within the created xml folder, create a file (e.g., custom_data_extraction_rules.xml
).
Add the data backup rules defined in the Airbridge SDK as follows.
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</cloud-backup>
<device-transfer>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</device-transfer>
</data-extraction-rules>
<manifest
...
xmlns:tools="http://schemas.android.com/tools">
<application
...
android:allowBackup="true"
android:fullBackupContent="@xml/custom_backup_rules"
android:dataExtractionRules="@xml/custom_data_extraction_rules"
tools:replace="android:fullBackupContent, android:dataExtractionRules">
<manifest
...
xmlns:tools="http://schemas.android.com/tools">
<application
...
android:allowBackup="true"
android:fullBackupContent="@xml/custom_backup_rules"
tools:replace="android:fullBackupContent">
GAID is being collected as 00000000-0000-0000-0000-000000000000 even though LAT (Limited Ad Tracking) is deactivated.
The AD_ID permission has been excluded due to other third-party libraries.
Add AD_ID permission.
<manifest ...>
...
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
...
</manifest>
このページは役に立ちましたか?
AirbridgeOption option = new AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
.setLifecycleIntegration(new AirbridgeLifecycleIntegration() {
@Nullable
@Override
public String getDataString(@NonNull Activity activity) {
if (activity.getClass().getName().equals("com.braze.push.NotificationTrampolineActivity")
&& activity.getIntent() != null
&& activity.getIntent().getExtras() != null) {
return activity.getIntent().getExtras().getString("uri");
}
return null;
}
})
})
.build();
Airbridge.initializeSDK(application, option);
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</full-backup-content>
Manifest merger failed : Attribute application@dataExtractionRules value=(string resource) from AndroidManifest.xml
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:32:9-36
is also present at [:airbridge] AndroidManifest.xml:27:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:30:5-250:19 to override.
AndroidManifest.xml: AAPT: error: attribute android:dataExtractionRules not found.
Attribute application@fullBackupContent value=(@xml/appsflyer_backup_rules) from [com.appsflyer:af-android-sdk:6.6.1] AndroidManifest.xml:14:18-73
is also present at [io.airbridge:sdk-android:2.14.0] AndroidManifest.xml:27:18-78 value=(@xml/airbridge_auto_backup_rules).
Suggestion: add 'tools:replace="android:fullBackupContent"' to <application> element at AndroidManifest.xml:7:5-13:19 to override.
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</full-backup-content>
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</cloud-backup>
<device-transfer>
<!-- Airbridge Backup Rules -->
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
<!-- Appsflyer Backup Rules -->
<exclude domain="sharedpref" path="appsflyer-data"/>
<!-- Your Custom Backup Rules -->
</device-transfer>
</data-extraction-rules>
<manifest
...
xmlns:tools="http://schemas.android.com/tools">
<application
...
android:allowBackup="true"
android:fullBackupContent="@xml/custom_backup_rules"
android:dataExtractionRules="@xml/custom_data_extraction_rules"
tools:replace="android:fullBackupContent, android:dataExtractionRules">
<manifest
...
xmlns:tools="http://schemas.android.com/tools">
<application
...
android:allowBackup="true"
android:fullBackupContent="@xml/custom_backup_rules"
tools:replace="android:fullBackupContent">
<manifest ...>
...
<uses-permission android:name="com.google.android.gms.permission.AD_ID" />
...
</manifest>
Manifest merger failed : Attribute application@fullBackupContent value=(string) from AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<data-extraction-rules>
<cloud-backup>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</cloud-backup>
<device-transfer>
<exclude domain="sharedpref" path="airbridge-internal" />
<exclude domain="sharedpref" path="airbridge-install" />
<exclude domain="sharedpref" path="airbridge-user-info" />
<exclude domain="sharedpref" path="airbridge-user-alias" />
<exclude domain="sharedpref" path="airbridge-user-attributes" />
<exclude domain="sharedpref" path="airbridge-device-alias" />
<exclude domain="database" path="airbridge.db" />
</device-transfer>
</data-extraction-rules>
java.lang.NoClassDefFoundError: kotlin/coroutines/AbstractCoroutineContextKey
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
...