StartApp广告错误

时间:2018-01-25 16:53:14

标签: android nullpointerexception ads startapp

错误如下:_

  

java.lang.NullPointerException:尝试在空对象引用上调用虚方法'int java.lang.Enum.ordinal()'                                                                                   在com.startapp.android.publish.cache.g.i(StartAppSDK:277)                                                                                   在com.startapp.android.publish.cache.g.j(StartAppSDK:374)                                                                                   at com.startapp.android.publish.cache.g $ 1.onFailedToReceiveAd(StartAppSDK:356)                                                                                   在com.startapp.android.publish.cache.i $ 3 $ 1.run(StartAppSDK:241)                                                                                   在android.os.Handler.handleCallback(Handler.java:754)                                                                                   在android.os.Handler.dispatchMessage(Handler.java:95)                                                                                   在android.os.Looper.loop(Looper.java:163)                                                                                   在android.app.ActivityThread.main(ActivityThread.java:6237)                                                                                   at java.lang.reflect.Method.invoke(Native Method)                                                                                   在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:877)                                                                                   在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

之前它工作正常,但现在出现了这个错误。

onCreate方法我称之为:

// StartAppSDK.init(this, "210075679", true);
setContentView(R.layout.activity_main);
StartAppSDK.init(MainActivity.this, "210075679", true);

1 个答案:

答案 0 :(得分:0)

我在Progaurd规则中添加了这个答案后得到了我的答案

-keep class com.startapp.** {*;}
-keepattributes Exceptions, InnerClasses, Signature, Deprecated, 
SourceFile,LineNumberTable, *Annotation*, EnclosingMethod
-dontwarn android.webkit.JavascriptInterface