java.lang.NoClassDefFoundError

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中,仅仅只是为了编译通过,则去掉勾选。

时间: 2024-10-28 21:20:40

java.lang.NoClassDefFoundError的相关文章

Spring boot ---- java.lang.NoClassDefFoundError: javax/servlet/ServletContext

场景描述 项目中用到spring boot进行带页面的开发,从github上的simples中下载了对应的spring-boot-sample-web-jsp项目,经简单修改之后死活启动不起来,各种异常.spring-boot以简单容易上手为核心宗旨,可为什么在引入jar时就会出现这么多问题呢? 异常信息 异常一: 2016-06-17 11:04:14.216 ERROR 4684 --- [ main] o.s.boot.SpringApplication : Application sta

java.lang.NoClassDefFoundError: com/opensymphony/x

问题:严重: Unable to read class [com.spml.action.AddUserAction]java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/finder/DefaultClassFinder$InfoBuildingVisitor    at com.opensymphony.xwork2.util.finder.DefaultClassFinder.readClassDef(DefaultCla

Java中使用json时java.lang.NoClassDefFoundError: net/sf/ezmorph/Morpher问题解决

下面代码: public static void main(String[] args) { JSONObject obj = new JSONObject(); obj.put("msg", "HELLO"); obj.put("path", "/pages/back/emp.jsp"); System.out.println(obj); } 如果遇到java.lang.NoClassDefFoundError: net/s

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

MyEclipse运行的时候报错,菜鸟不理解是什么意思,最后找了一些资料才知道是因为缺少commons-logging.jar包 Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.apache.commons.httpclient.HttpClient.<clinit>(HttpClient.java:66) at c

java.lang.NoClassDefFoundError 怎么解决

java.lang.NoClassDefFoundError:找不到相应的类文件,当编译源文件以后都会生成一些类文件:***.class,执行时要用java(main所在的类) ,如果找不到相应的类,执行就会出现NoClassDefFoundError的异常.1.首先请确认没有错敲成java xxx.class,2.其次,检查CLASSPATH环境变量,3.将java文件按包名存放:比如工作目录是/work,类是package1.class1,那么将它存放为/work/package1/clas

java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/QueuedThreadPool$1

1.错误描述 [WARNING] FAILED qtp1691065417{8<=8<=8/254,0}: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/QueuedThreadPool$1 [WARNING] FAILED [email protected]: java.lang.NoClassDefFoundError: org/eclipse/jetty/util/thread/QueuedThreadPool

eclipse启动错误:java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer

转自:http://blog.csdn.net/niu_hao/article/details/9332521 eclipse启动时报错如下:java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer解决方法:可能是丢失部分起动文件,解决... eclipse启动时报错如下: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IContainer 解

Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: Demo (wrong name: com/zhangyun/Demo)解决办法

介绍一个Java初学者可能会遇到的问题 首先,创建一个类,如下: 文件名:Demo.java package com.zhangyun; public class Demo { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Hello World!"); } } 然后我找到对应在磁盘的位置,如下: E

(转)Android工程出现 java.lang.NoClassDefFoundError错误解决方法

在Eclipse中,导入Android工程,工程没有报错,运行时,出现 java.lang.NoClassDefFoundError类没有找到的错误.从问题上可以看出是导入包出错的原因.遂百度加谷歌. 问题出在:ADT高版本的原因 把引入的第三方包放在Referenced Libraries中,ADT升级到17后就出现了Android Dependencies,所以如果程序中引入的第三方包没有在Android Dependencies中时,就会报文章开头的错. 解决方法: 先移除之前的Refer

java.lang.NoClassDefFoundError 异常

在项目实施过程中,当访问某一个功能时,出现异常为  java.lang.NoClassDefFoundError  com/xxx/yyy/Zzzz > ,检查发现这个类实际已经存在于应用服务器的部署目录中.于是根据class调用的过程去排查这个类,发现代码有一处异常捕获,大概是如下样子. 1 public class Test{ 2 3 public void test1() { 4 System.out.println("test1"); 5 } 6 7 public voi