Search code examples
javaandroidadobeadobe-analytics

Adobe Omniture For Android fails on trackAction


I'm having trouble with making Adobe Omniture work consistently with Android. I call trackAction at parts of the app, and at half of the time, it fails when I call it at app launch.

Just some info, I'm using the latest version of Omniture (4.11.0 at the time of this writing), and I added the 4.11.0 jar file under app/libs folder and I added ADMobileConfig.json file under app/assets.

For build.gradle file, the minimum SDK is set 19 and target SDK is set to 20.

Any input is greatly appreciated.

This is the message that I got when I launch it:

08-09 15:13:22.096 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Unable to get package to pull application name. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.097 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Unable to get package to pull application version. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.100 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Unable to get package to pull application version code. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.107 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Error getting device resolution. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.107 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Error getting device carrier. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.114 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Analytics - Error registering network receiver (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.114 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Null context when attempting to read config file (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.115 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Null context when attempting to read config file (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.116 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Unable to pull visitorID from shared preferences. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.117 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Lifecycle - Issue loading persisted lifecycle data 08-09 15:13:22.148 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Error getting cache directory. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.148 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Error getting cache directory. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.148 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Config - Error getting cache directory. (Config - No Application Context (Application context must be set prior to calling any library functions.))

08-09 15:13:22.158 29529-30479/com.example.application E/SQLiteLog: (14) os_unix.c:30199: (2) open(//ADBMobileDataCache.sqlite) -

08-09 15:13:22.181 29529-30479/com.example.application E/SQLiteDatabase: Failed to open database 'ADBMobileDataCache.sqlite'. android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209) at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193) at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177) at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804) at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:669) at com.adobe.mobile.AbstractDatabaseBacking.openOrCreateDatabase(AbstractDatabaseBacking.java:47) at com.adobe.mobile.AbstractDatabaseBacking.initDatabaseBacking(AbstractDatabaseBacking.java:68) at com.adobe.mobile.AnalyticsWorker.(AnalyticsWorker.java:77) at com.adobe.mobile.AnalyticsWorker.sharedInstance(AnalyticsWorker.java:64) at com.adobe.mobile.RequestBuilder.buildAndSendRequest(RequestBuilder.java:117) at com.adobe.mobile.AnalyticsTrackAction.trackAction(AnalyticsTrackAction.java:38) at com.adobe.mobile.Analytics$2.run(Analytics.java:81) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841)

08-09 15:13:22.181 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Analytics - Unable to open database (unknown error (code 14): Could not open database).

08-09 15:13:22.181 29529-30479/com.example.application E/ADBMobile: ADBMobile Error : Analytics - Unable to get tracking queue size due to an unopened database (null)


Solution

  • According to the error, it seems that you didn't set the application context on the activity's onCreate method:

    Config.setContext(this.getApplicationContext());