============问题描述============
10-01 12:37:51.070: E/AndroidRuntime(4385): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=10001, result=-1, data=Intent { (has extras) }} to activity {com.kamagames.legacyoftheempire/com.wonder.fengmo.GameActivity}: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread.deliverResults(ActivityThread.java:3319)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread.access$1100(ActivityThread.java:141)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.os.Handler.dispatchMessage(Handler.java:99)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.os.Looper.loop(Looper.java:137)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread.main(ActivityThread.java:5039)
10-01 12:37:51.070: E/AndroidRuntime(4385): at java.lang.reflect.Method.invokeNative(Native Method)
10-01 12:37:51.070: E/AndroidRuntime(4385): at java.lang.reflect.Method.invoke(Method.java:511)
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
10-01 12:37:51.070: E/AndroidRuntime(4385): at dalvik.system.NativeStart.main(Native Method)
10-01 12:37:51.070: E/AndroidRuntime(4385): Caused by: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.wonder.fengmo.Security.generatePublicKey(Security.java:89)
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.wonder.fengmo.Security.verifyPurchase(Security.java:63)
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.wonder.fengmo.IabHelper.handleActivityResult(IabHelper.java:493)
10-01 12:37:51.070: E/AndroidRuntime(4385): at com.wonder.fengmo.GameActivity.onActivityResult(GameActivity.java:215)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.Activity.dispatchActivityResult(Activity.java:5293)
10-01 12:37:51.070: E/AndroidRuntime(4385): at android.app.ActivityThread.deliverResults(ActivityThread.java:3315)
10-01 12:37:51.070: E/AndroidRuntime(4385): ... 11 more
块来帮我看看BUG呀 什么情况这是?????
============解决方案1============
很明显不是 onActivityResult 的问题啊,你看崩溃 log, 上面写着Caused by: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long,,应该是你在 onActivityResult 中某个方法中传入参数格式错误,,
============解决方案2============
Caused by: java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long
传入的key格式不对。