Migrate to Adobe Experience Platform 3.x SDKs for Android
data-variant=info
data-slots=text
SDK versions
Android BOM
Android extensions
Migrate from Adobe Experience Platform 2.x SDKs for Android
If you have implemented Adobe Experience Platform 2.x SDKs for Android, then this guide will help you understand the steps required to migrate your implementation to the Experience Platform 3.x SDKs. In summary, you'll need to:
Update dependencies
When updating to the Experience Platform 3.x SDKs, be sure to review the following updates regarding dependencies.
Gradle
The Adobe SDK BOM artifact enables managing all compatible versions of Adobe Experience Platform Android extensions by specifying a single BOM version. This is now the recommended way to manage Android SDKs. If you are using Gradle to manage your app dependencies, the following example shows how to start using BOM in the build.gradle file.
data-variant=warning
data-slots=text
dependencies {
// implementation platform('com.adobe.marketing.mobile:sdk-bom:2.+')
// implementation 'com.adobe.marketing.mobile:core'
// implementation 'com.adobe.marketing.mobile:identity'
// implementation 'com.adobe.marketing.mobile:signal'
// implementation 'com.adobe.marketing.mobile:lifecycle'
// implementation 'com.adobe.marketing.mobile:userprofile'
// Update Adobe SDK BOM artifact to the latest 3.x.x version.
implementation platform('com.adobe.marketing.mobile:sdk-bom:3.+')
implementation 'com.adobe.marketing.mobile:core'
implementation 'com.adobe.marketing.mobile:identity'
implementation 'com.adobe.marketing.mobile:signal'
implementation 'com.adobe.marketing.mobile:lifecycle'
implementation 'com.adobe.marketing.mobile:userprofile'
}
Save the build.gradle file and select Sync Project with Gradle Files in Android Studio to download the 3.x SDKs.
Manual library import
If you are importing SDK libraries manually, make sure to update your libraries by downloading the most recent 3.x binaries directly from Maven Central Repository.
Update SDK initialization
The MobileCore.start() API and the registerExtension API for each extension, which were deprecated in the 2.x version of the mobile SDK, have been removed in the 3.x version. If you're still using these APIs, refer here to initialize the SDK and register the extensions using the MobileCore.registerExtensions() API.
Handle API migration and breaking changes
Some of the APIs available in previous major versions of the Mobile SDK for Android are now deprecated or removed. You can choose to replace the obsolete APIs in your code with the alternative APIs in the 3.x version, as described below.
data-variant=warning
data-slots=text
registerExtension API for each extension that was deprecated in the 2.x version of the mobile SDK has been removed in the 3.x version of the mobile SDK. See the Update SDK initialization section for more details.MobileCore
Extension Development
Core 3.0.0 is not binary compatible with extensions built using earlier versions. Third-party extension developers are required to recompile their extensions with this version of Core.
ExtensionListener, ExtensionError, ExtensionUnexpectedError, ExtensionErrorCallback classes have been removed as they are no longer referenced after above API changes.
UserProfile
Edge Bridge
As of version 3.0.0 of the Adobe Experience Platform Edge Bridge for Android, the table below shows how the trackAction and trackState parameters map to the data node of the Experience Event sent to the Experience Platform Edge Network. Edge Network automatically maps these data variables to Adobe Analytics without additional server-side configuration. If you are using Edge Bridge version 2.x and mapping data to XDM in your datastream, adjustments are required for version 3.0.0.
data.actiondata.__adobe.analytics.linkNamedata.__adobe.analytics.linkType with value other is also automatically included.data.statedata.__adobe.analytics.pageNamedata.contextdatadata.__adobe.analytics.contextDatatrackAction and trackState API calls.data.contextdatadata.__adobe.analytics&&products is sent as data.__adobe.analytics.products. Please note that these keys must be known to Analytics and are case sensitive. Find the full list of supported Analytics variables here.data.__adobe.analytics.contextData.a.AppIDa.AppID.data.__adobe.analytics.cpforeground or background.Track action example
Given the track action call:
MobileCore.trackAction("action name", mapOf("key" to "value", "&&products" to ";Running Shoes;1;69.95;event1|event2=55.99;eVar1=12345"))
The resulting Experience Event has the following payload:
{
"data":{
"__adobe": {
"analytics": {
"linkName": "action name",
"linkType": "other",
"cp": "foreground",
"products": ";Running Shoes;1;69.95;event1|event2=55.99;eVar1=12345",
"contextData":{
"a.AppID": "myApp 1.0 (1)",
"key": "value"
}
}
}
}
}
Track state example
Given the track state call:
MobileCore.trackState("view name", mapOf("&&events" to "event5,event2=2"))
The resulting Experience Event has the following payload:
{
"data":{
"__adobe": {
"analytics": {
"pageName": "view name",
"cp": "foreground",
"events": "event5,event2=2",
"contextData":{
"a.AppID": "myApp 1.0 (1)"
}
}
}
}
}
Edge
Adobe Analytics - Media Analytics for Audio & Video
Please note that the increment to 3.1.0 was preferred for this release in order to synchronize all extensions to same major version. For more details, see this article on aligning major version releases for Adobe Experience Platform Mobile SDKs.
Messaging
Optimize
Adobe Campaign Classic
Frequently asked questions
Why do I see 'unresolved reference' errors related to MessagingDelegate when upgrading to 3.x SDK?
The Mobile Core 3.x SDK for Android includes changes to SDK presentation management that break compatiblity with earlier versions of the SDK. com.adobe.marketing.mobile.services.MessagingDelegate and its usage has been removed in favor of com.adobe.marketing.mobile.services.ui.PresentationDelegate. If your application uses MessagingDelegate for granular control of in-app messages, refer to this page for more details on using PresentationDelegate.
Why do I see 'java.lang.NoSuchMethodError' after upgrading to the 3.x version of Mobile SDK for Android?
The Mobile Core 3.x SDK for Android includes changes that break compatiblity with solution SDKs developed for earlier verisons of the Mobile Core SDK.
If you attempt to use 3.x Mobile Core SDK with solution SDKs that were built for previous versions of Mobile Core in your app, you may encounter the following errors:
2024-04-03 17:45:02.501 XXXXX-XXXX/XXXX E/AndroidRuntime: FATAL EXCEPTION: main
Process: XXX, PID: XXXXXX
java.lang.NoSuchMethodError: No static method getCore()Lcom/adobe/marketing/mobile/Core; in class Lcom/adobe/marketing/mobile/MobileCore; or its super classes (declaration of 'com.adobe.marketing.mobile.MobileCore' appears in XXX
2024-04-03 17:45:02.501 XXXXX-XXXX/XXXX E/AndroidRuntime: FATAL EXCEPTION: main
Process: XXX, PID: XXXXX
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/adobe/marketing/mobile/ExtensionErrorCallback;
To resolve these errors, upgrade all your solution SDKs to the most recent versions using Adobe SDK BOM.
Why do I see installation instructions related to older SDK versions on Data Collection UI?
Upgrade the extensions within the mobile property in the Data Collection UI to see latest installation instructions for the mobile platform extensions.