简体   繁体   中英

Google analytics problems after play services upgrade to 7.5

After we upgraded Google Play Services to:

compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-analytics:7.5.0'

Note that docs say we have to use play-services-analytics:7.3.0, however since we are using play services 7.5, we have used the configurations stated at the start.

The app compiles fine but we've noticed our Google Analytics no longer send to our server. And also whenever we make call Tracker.send() the following lines will appear in the error log per event:

06-30 10:51:43.188  13623-13752/com.fairfax.domain E/SQLiteLog﹕ (1032) statement aborts at 31: [INSERT OR REPLACE  INTO properties(cid,app_uid,hits_count,adid,params,tid) VALUES (?,?,?,?,?,?)]
06-30 10:51:43.198  13623-13752/com.fairfax.domain E/GAv4﹕ Error storing a property: android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
06-30 10:51:44.348  13623-13752/com.fairfax.domain E/SQLiteLog﹕ (1032) statement aborts at 31: [INSERT OR REPLACE  INTO properties(cid,app_uid,hits_count,adid,params,tid) VALUES (?,?,?,?,?,?)]
06-30 10:51:44.358  13623-13752/com.fairfax.domain E/GAv4﹕ Error storing a property: android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032)
06-3

We proxied the traffic and saw that indeed it did not seem to send the GA events.

As a workaround for now we made the change to manual dispatching:

analytics.setLocalDispatchPeriod(0);

and manually calling:

GoogleAnalytics.getInstance(appContext).dispatchLocalHits();

But of course this is less than ideal, how would we let Google Analytics Handle storing/sending based on configurations and not get the errors?

UPD: It is probably worth mentioning that we're upgrading from play services 6.5.

UPD2: We proxied network again and now it appears that GA does send /batch request after a while. Those SQLite errors are still present though:

8273-8329/com.fairfax.domain E/SQLiteLog﹕ (1032) statement aborts at 29: [INSERT OR REPLACE  INTO properties(cid,app_uid,hits_count,adid,params,tid) VALUES (?,?,?,?,?,?)]

Is SQLiteLog a class you wrote or Google Analytics provides? If you're using a DBHelper you could try getWritableDatabase() on it.

Do you have any long running services that might be using the old database, or have some lock in it?

You could also try bumping your build number on the app, and looking into a SQL migration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM