最近,我的應用程序有一些與異常崩潰報告:的Android的StringIndexOutOfBoundsException內谷歌Analytics(分析)SDK
0 java.lang.StringIndexOutOfBoundsException: length=8; regionStart=0; regionLength=32
1 at java.lang.String.startEndAndLength(String.java:593)
2 at java.lang.String.substring(String.java:1474)
3 at com.google.ads.util.AdUtil.b(SourceFile:447)
4 at com.google.ads.AdRequest.<clinit>(SourceFile:210)
5 at java.lang.Class.classForName(Native Method)
6 at java.lang.Class.forName(Class.java:217)
7 at java.lang.Class.forName(Class.java:172)
8 at com.google.analytics.tracking.android.AdHitIdGenerator.<init>(AdHitIdGenerator.java:17)
9 at com.google.analytics.tracking.android.GoogleAnalytics.<init>(GoogleAnalytics.java:65)
10 at com.google.analytics.tracking.android.GoogleAnalytics.<init>(GoogleAnalytics.java:56)
11 at com.google.analytics.tracking.android.GoogleAnalytics.getInstance(GoogleAnalytics.java:92)
12 at com.buscaalimento.android.proxies.GoogleAnalyticsProxy.<init>(GoogleAnalyticsProxy.java:26)
13 at com.buscaalimento.android.proxies.GoogleAnalyticsProxy.createInstance(GoogleAnalyticsProxy.java:40)
顯然,它作用似乎是谷歌Analytics(分析)SDK罐內的錯誤。我使用JD-GUI工具查看jar內的代碼。誰引發異常的行看起來像:
AdHitIdGenerator.java:
try
{
this.mAdMobSdkInstalled = (Class.forName("com.google.ads.AdRequest") != null);
} catch (ClassNotFoundException e) {
this.mAdMobSdkInstalled = false;
}
的代碼(我的代碼)誰調用Google分析類是這樣的:
public GoogleAnalyticsProxy(Context context) {
GoogleAnalytics gaInstance = GoogleAnalytics.getInstance(context);
if (DietaeSaudeApplication.isDebugging() || FORCE_DEBUG) {
MvLog.d(this, "Running in debug mode!!");
mTracker = gaInstance.getTracker(DEBUG_TRACKING_ID);
gaInstance.setDebug(true);
} else {
MvLog.d(this, "Running in release mode!!");
mTracker = gaInstance.getTracker(RELEASE_TRACKING_ID);
gaInstance.setDebug(false);
}
GAServiceManager.getInstance().setDispatchPeriod(30); //dispatch a cada 30 segundos
}
的例外發生這種情況line:
GoogleAnalytics gaInstance = GoogleAnalytics.getInstance(context);
此代碼在應用程序類中調用,其中我創建了我的應用程序的單身人士。 我真的不知道這個錯誤。任何人都通過了這個問題?
StringIndexOutOfBoundsException在哪裏? – npace
我編輯了問題,現在用StringIndexOutOfBoundsException堆棧跟蹤 –