Kon*_*rov 18 android google-analytics google-play-services
我们将Google Play服务升级为:
compile 'com.google.android.gms:play-services-base:7.5.0'
compile 'com.google.android.gms:play-services-analytics:7.5.0'
Run Code Online (Sandbox Code Playgroud)
请注意,文档说我们必须使用play-services-analytics:7.3.0,但是由于我们使用的是Play服务7.5,因此我们使用了开头所述的配置.
该应用程序编译良好,但我们注意到我们的Google Analytics不再发送到我们的服务器.而且每当我们调用Tracker.send()时,每个事件的错误日志中都会出现以下行:
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
Run Code Online (Sandbox Code Playgroud)
我们代理了流量,看到它确实似乎没有发送GA事件.
作为现在的解决方法,我们对手动调度进行了更改:
analytics.setLocalDispatchPeriod(0);
Run Code Online (Sandbox Code Playgroud)
并手动调用:
GoogleAnalytics.getInstance(appContext).dispatchLocalHits();
Run Code Online (Sandbox Code Playgroud)
但当然这不太理想,我们如何让谷歌分析处理存储/发送基于配置而不是错误?
UPD:值得一提的是,我们正在从游戏服务6.5升级.
UPD2:我们再次代理网络,现在看来GA会在一段时间后发送/批量请求.那些SQLite错误仍然存在:
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 (?,?,?,?,?,?)]
Run Code Online (Sandbox Code Playgroud)
小智 0
SQLiteLog 是您编写的类还是 Google Analytics 提供的类?如果您使用 DBHelper,您可以尝试使用 getWritableDatabase() 。
您是否有任何长时间运行的服务可能正在使用旧数据库,或者对其有一些锁定?
您还可以尝试提高应用程序的内部版本号,并研究 SQL 迁移。
| 归档时间: |
|
| 查看次数: |
426 次 |
| 最近记录: |