简体   繁体   中英

Google Analytics fails on startup

I follow the tutorial on enabling Google Analytics for one of my apps. This seems to work fine for API level 17 and a Samsung Galaxy 4.

However, when installing the app on an old API Level 4 G1, the app fails with the following error:

Uncaught handler: thread client_id_fetcher exiting due to uncaught exception
java.lang.NullPointerException
  at android.app.ApplicationContext.openFileOutput(ApplicationContext.java:405)
  at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158)
  at com.google.analytics.tracking.android.ClientIdDefaultProvider.storeClientId(ClientIdDefaultProvider.java:102)
  at com.google.analytics.tracking.android.ClientIdDefaultProvider.generateClientId(ClientIdDefaultProvider.java:123)
  at com.google.analytics.tracking.android.ClientIdDefaultProvider.initializeClientId(ClientIdDefaultProvider.java:179)
  at com.google.analytics.tracking.android.ClientIdDefaultProvider$1.run(ClientIdDefaultProvider.java:134)

Are there API level requirements for Google Analytics for Android?

Google Analytics V2和新版V3 Beta附带的自述文件均指出最低SDK为2.1(v7)。

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