02-15 09:57:49.170: D/ActivityThread(25210): handleBindApplication:com.poxiao.fish
02-15 09:57:49.170: D/ActivityThread(25210): setTargetHeapUtilization:0.75
02-15 09:57:49.170: D/ActivityThread(25210): setTargetHeapMinFree:2097152
02-15 09:57:49.200: E/com.poxiao.fish(25210): 检查应用是否可见
02-15 09:57:49.200: E/com.poxiao.fish(25210): --------- 应用可见[com.poxiao.fish] --------
02-15 09:57:49.200: D/com.poxiao.fish(25210): action=com.poxiao.fish.setting.service.MusicPlayService.AIDLAction
02-15 09:57:49.210: W/ContextImpl(25210): Implicit intents with startService are not safe: Intent { act=com.poxiao.fish.setting.service.MusicPlayService.AIDLAction } android.content.ContextWrapper.bindService:542 com.poxiao.fish.FishCatchApplication.bindPlayerService:470 com.poxiao.fish.FishCatchApplication.onCreate:57
02-15 09:57:49.210: I/dalvikvm(25210): Failed resolving Lcom/poxiao/pay/xbll/GamePay$5; interface 905 'Lcn/cmgame/billing/api/GameInterface$GameExitCallback;'
02-15 09:57:49.210: W/dalvikvm(25210): Link of class 'Lcom/poxiao/pay/xbll/GamePay$5;' failed
02-15 09:57:49.210: E/dalvikvm(25210): Could not find class 'com.poxiao.pay.xbll.GamePay$5', referenced from method com.poxiao.pay.xbll.GamePay.exitGame
02-15 09:57:49.210: W/dalvikvm(25210): VFY: unable to resolve new-instance 1686 (Lcom/poxiao/pay/xbll/GamePay$5;) in Lcom/poxiao/pay/xbll/GamePay;
02-15 09:57:49.210: D/dalvikvm(25210): VFY: replacing opcode 0x22 at 0x0000
02-15 09:57:49.210: I/dalvikvm(25210): Could not find method cn.cmgame.billing.api.GameInterface.isMusicEnabled, referenced from method com.poxiao.pay.xbll.GamePay.getMusicSwitch
02-15 09:57:49.210: W/dalvikvm(25210): VFY: unable to resolve static method 6300: Lcn/cmgame/billing/api/GameInterface;.isMusicEnabled ()Z
02-15 09:57:49.210: D/dalvikvm(25210): VFY: replacing opcode 0x71 at 0x0009
02-15 09:57:49.210: I/dalvikvm(25210): Could not find method cn.cmgame.billing.api.GameInterface.viewMoreGames, referenced from method com.poxiao.pay.xbll.GamePay.moreGame
02-15 09:57:49.210: W/dalvikvm(25210): VFY: unable to resolve static method 6301: Lcn/cmgame/billing/api/GameInterface;.viewMoreGames (Landroid/content/Context;)V
02-15 09:57:49.210: D/dalvikvm(25210): VFY: replacing opcode 0x71 at 0x0000
02-15 09:57:49.210: I/dalvikvm(25210): Failed resolving Lcom/poxiao/pay/xbll/GamePay$5; interface 905 'Lcn/cmgame/billing/api/GameInterface$GameExitCallback;'
02-15 09:57:49.210: W/dalvikvm(25210): Link of class 'Lcom/poxiao/pay/xbll/GamePay$5;' failed
02-15 09:57:49.210: D/dalvikvm(25210): DexOpt: unable to opt direct call 0x2dea at 0x02 in Lcom/poxiao/pay/xbll/GamePay;.exitGame
02-15 09:57:49.210: W/SystemTheme/Resources(25210): createSystemThemeIfNeeded
02-15 09:57:49.210: I/SystemThemeResource(25210): SystemThemeResource: set to default lenovo theme
02-15 09:57:49.420: D/===AVOS Cloud===(25210): LogUtil$avlog->d->24: try to fetch host list
02-15 09:57:49.420: I/com。poxiao.fish(25210): playerId =
02-15 09:57:49.420: D/dalvikvm(25210): Trying to load lib /data/app-lib/com.poxiao.fish-1/libmegjb.so 0x42736980
02-15 09:57:49.420: D/dalvikvm(25210): Added shared lib /data/app-lib/com.poxiao.fish-1/libmegjb.so 0x42736980
02-15 09:57:49.460: D/dalvikvm(25210): Trying to load lib /data/data/com.poxiao.fish/files/libmegbpp_02.02.09_00.so 0x42736980
02-15 09:57:49.460: D/dalvikvm(25210): Added shared lib /data/data/com.poxiao.fish/files/libmegbpp_02.02.09_00.so 0x42736980
02-15 09:57:50.390: V/Activity(25210): onCreate mComponent: ComponentInfo{com.poxiao.fish/com.poxiao.fish.activity.SplashActivity}; mActivityInfo.parentActivityName: null
02-15 09:57:50.550: E/HWACC(25210): owner.packageName = com.skymobi.pay.sprpush; hardwareAccelerated = false
02-15 09:57:50.560: E/HWACC(25210): owner.packageName = com.skymobi.pay.sprpush; hardwareAccelerated = false
02-15 09:57:50.560: D/dalvikvm(25210): DexOpt: --- BEGIN 'com.skymobi.pay.sprpush.apk' (bootstrap=0) ---
02-15 09:57:50.740: D/dalvikvm(25210): DexOpt: --- END 'com.skymobi.pay.sprpush.apk' (success) ---
02-15 09:57:50.740: D/dalvikvm(25210): DEX prep '/storage/sdcard0/Android/data/com.skymobi.push/plugins/com.skymobi.pay.sprpush.apk': unzip in 3ms, rewrite 172ms
02-15 09:57:50.740: D/TelephonyManager(25210): getDeviceIdEx simId=0
02-15 09:57:50.770: D/TelephonyManager(25210): getDeviceIdEx simId=0
02-15 09:57:50.770: D/TelephonyManager(25210): getDeviceIdEx simId=0
02-15 09:57:50.790: E/HWACC(25210): owner.packageName = com.skymobi.pay.sprpush; hardwareAccelerated = false
02-15 09:57:50.800: E/HWACC(25210): owner.packageName = com.skymobi.pay.sprpush; hardwareAccelerated = false
02-15 09:57:50.900: D/AndroidRuntime(25210): Shutting down VM
02-15 09:57:50.900: W/dalvikvm(25210): threadid=1: thread exiting with uncaught exception (group=0x41e48d58)
02-15 09:57:50.900: I/SwitchUtil(25210): networkType=1
02-15 09:57:50.910: E/AVUncaughtExceptionHandler(25210): AVUncaughtExceptionHandler caught a NoClassDefFoundError exception
02-15 09:57:51.010: I/SwitchUtil(25210): result={"state":"1"}
02-15 09:57:51.020: E/AndroidRuntime(25210): FATAL EXCEPTION: main
02-15 09:57:51.020: E/AndroidRuntime(25210): Process: com.poxiao.fish, PID: 25210
02-15 09:57:51.020: E/AndroidRuntime(25210): java.lang.NoClassDefFoundError: cn.cmgame.billing.api.GameInterface
02-15 09:57:51.020: E/AndroidRuntime(25210): at com.poxiao.pay.xbll.GamePay.getMusicSwitch(GamePay.java:214)
02-15 09:57:51.020: E/AndroidRuntime(25210): at com.poxiao.fish.activity.SplashActivity.onCreate(SplashActivity.java:32)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.Activity.performCreate(Activity.java:5246)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.ActivityThread.access$800(ActivityThread.java:143)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.os.Handler.dispatchMessage(Handler.java:102)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.os.Looper.loop(Looper.java:136)
02-15 09:57:51.020: E/AndroidRuntime(25210): at android.app.ActivityThread.main(ActivityThread.java:5195)
02-15 09:57:51.020: E/AndroidRuntime(25210): at java.lang.reflect.Method.invokeNative(Native Method)
02-15 09:57:51.020: E/AndroidRuntime(25210): at java.lang.reflect.Method.invoke(Method.java:515)
02-15 09:57:51.020: E/AndroidRuntime(25210): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
02-15 09:57:51.020: E/AndroidRuntime(25210): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:603)
02-15 09:57:51.020: E/AndroidRuntime(25210): at dalvik.system.NativeStart.main(Native Method)
解决方法
<还是有问题>
Android动态加载jar,apk/dex
在动态加载Android的jar,apk,和dex时,容易产生如下的异常:
java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
这是由于重复加载了class文件导致的。
检查一下:
project->properties->Java Build Path->Order and Export
其中引入的包前面不打勾,则引入包的作用是仅仅让项目编译能够成功,此引入的包不会打包到最终的程序apk中去。
因为引入的包前面打勾选,则该引入的包最终会被打包到最终的程序apk安装包中。
如果引入的包不需要打包到apk中,仅仅只是为了编译通过,则去掉勾选。