- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在运行低于 API 版本 21 的手机上遇到 noClassDefFoundError。首先它与其他类一起出现,在删除所有可能的代码后,它开始与 Picasso 库一起出现。我附上了我的 logcat 和 build.gradle。
请帮助我,我被困住了,我尝试了很多解决方案,但没有一个有效。
我发现的类似问题是 - https://github.com/square/picasso/issues/1264
build.gradle -
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
dexOptions {
incremental false
javaMaxHeapSize "2048M"
preDexLibraries = false
}
defaultConfig {
applicationId "com.kaaryanext.raghukaka"
minSdkVersion 15
targetSdkVersion 23
versionCode 25
versionName "1.2.14"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-android.txt'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.code.gson:gson:2.2.4'
compile('com.android.support:appcompat-v7:23.1.1') {
exclude module: 'support-v4'
}
compile 'com.crittercism:crittercism-android-agent:5.0.6'
compile 'com.android.support:support-v4:23.1.1'
compile "com.android.support:recyclerview-v7:23.1.0"
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile "com.google.android.gms:play-services:8.1.0"
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:23.1.1'
compile 'com.getbase:floatingactionbutton:1.10.0'
compile 'com.loopj.android:android-async-http:1.4.9'
}
04-18 09:53:10.990 16825-16825/com.kaaryanext.raghukaka E/dalvikvm: Could not find class 'com.squareup.picasso.Picasso$1', referenced from method com.squareup.picasso.Picasso. 04-18 09:53:10.990 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve new-instance 9172 (Lcom/squareup/picasso/Picasso$1;) in Lcom/squareup/picasso/Picasso; 04-18 09:53:10.990 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x22 at 0x0000 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Dispatcher;) 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Cache;) 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Stats;) 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka E/dalvikvm: Could not find class 'com.squareup.picasso.ResourceRequestHandler', referenced from method com.squareup.picasso.Picasso. 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve new-instance 9190 (Lcom/squareup/picasso/ResourceRequestHandler;) in Lcom/squareup/picasso/Picasso; 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x22 at 0x001d 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Utils.checkMain, referenced from method com.squareup.picasso.Picasso.cancelExistingRequest 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve static method 61383: Lcom/squareup/picasso/Utils;.checkMain ()V 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x71 at 0x0000 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Action;) 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Action.isCancelled, referenced from method com.squareup.picasso.Picasso.deliverAction 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61214: Lcom/squareup/picasso/Action;.isCancelled ()Z 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0000 04-18 09:53:11.000 16825-16825/com.kaaryanext.raghukaka E/dalvikvm: Could not find class 'com.squareup.picasso.RemoteViewsAction$RemoteViewsTarget', referenced from method com.squareup.picasso.Picasso.cancelRequest 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve new-instance 9184 (Lcom/squareup/picasso/RemoteViewsAction$RemoteViewsTarget;) in Lcom/squareup/picasso/Picasso; 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x22 at 0x0000 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Target;) 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Utils.checkMain, referenced from method com.squareup.picasso.Picasso.cancelTag 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve static method 61383: Lcom/squareup/picasso/Utils;.checkMain ()V 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x71 at 0x0000 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/BitmapHunter;) 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.BitmapHunter.getAction, referenced from method com.squareup.picasso.Picasso.complete 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61218: Lcom/squareup/picasso/BitmapHunter;.getAction ()Lcom/squareup/picasso/Action; 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/DeferredRequestCreator;) 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Action;) 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Action.getTarget, referenced from method com.squareup.picasso.Picasso.enqueueAndSubmit 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61213: Lcom/squareup/picasso/Action;.getTarget ()Ljava/lang/Object; 04-18 09:53:11.010 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0000 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Stats.createSnapshot, referenced from method com.squareup.picasso.Picasso.getSnapshot 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61376: Lcom/squareup/picasso/Stats;.createSnapshot ()Lcom/squareup/picasso/StatsSnapshot; 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Cache.clearKeyUri, referenced from method com.squareup.picasso.Picasso.invalidate 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve interface method 61226: Lcom/squareup/picasso/Cache;.clearKeyUri (Ljava/lang/String;)V 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x72 at 0x0010 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Dispatcher.dispatchPauseTag, referenced from method com.squareup.picasso.Picasso.pauseTag 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61235: Lcom/squareup/picasso/Dispatcher;.dispatchPauseTag (Ljava/lang/Object;)V 04-18 09:53:11.020 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Cache.get, referenced from method com.squareup.picasso.Picasso.quickMemoryCacheCheck 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve interface method 61227: Lcom/squareup/picasso/Cache;.get (Ljava/lang/String;)Landroid/graphics/Bitmap; 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Action;) 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve instance field 34051 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x52 at 0x0001 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Dispatcher.dispatchResumeTag, referenced from method com.squareup.picasso.Picasso.resumeTag 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61236: Lcom/squareup/picasso/Dispatcher;.dispatchResumeTag (Ljava/lang/Object;)V 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Cache.clear, referenced from method com.squareup.picasso.Picasso.shutdown 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve interface method 61225: Lcom/squareup/picasso/Cache;.clear ()V 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x72 at 0x0013 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Action;) 04-18 09:53:11.030 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Dispatcher.dispatchSubmit, referenced from method com.squareup.picasso.Picasso.submit 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve virtual method 61237: Lcom/squareup/picasso/Dispatcher;.dispatchSubmit (Lcom/squareup/picasso/Action;)V 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/squareup/picasso/Request;) 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: Could not find method com.squareup.picasso.Picasso$RequestTransformer.transformRequest, referenced from method com.squareup.picasso.Picasso.transformRequest 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: VFY: unable to resolve interface method 61271: Lcom/squareup/picasso/Picasso$RequestTransformer;.transformRequest (Lcom/squareup/picasso/Request;)Lcom/squareup/picasso/Request; 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef46 at 0x06 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xefbe at 0x1f in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef2d at 0x2c in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.040 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef43 at 0x34 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef2e at 0x3c in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef20 at 0x44 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef3f at 0x4c in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x8505 at 0x54 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef45 at 0x56 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef53 at 0x87 in Lcom/squareup/picasso/Picasso;. 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x8504 at 0x2d in Lcom/squareup/picasso/Picasso;.deliverAction 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x8504 at 0x55 in Lcom/squareup/picasso/Picasso;.deliverAction 04-18 09:53:11.050 16825-16825/com.kaaryanext.raghukaka D/dalvikvm: DexOpt: unable to opt direct call 0xef81 at 0x02 in Lcom/squareup/picasso/Picasso;.cancelRequest 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x852f at 0x21 in Lcom/squareup/picasso/Picasso;.complete 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize static field ref 0x8518 at 0x13 in Lcom/squareup/picasso/Picasso;.resumeAction 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x8504 at 0x20 in Lcom/squareup/picasso/Picasso;.resumeAction 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize static field ref 0x8518 at 0x31 in Lcom/squareup/picasso/Picasso;.resumeAction 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka I/dalvikvm: DexOpt: unable to optimize instance field ref 0x8504 at 0x4a in Lcom/squareup/picasso/Picasso;.resumeAction 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/squareup/picasso/Picasso; 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka D/AndroidRuntime: Shutting down VM 04-18 09:53:11.060 16825-16825/com.kaaryanext.raghukaka W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x418b1c80) 04-18 09:53:11.080 16825-16825/com.kaaryanext.raghukaka E/AndroidRuntime: FATAL EXCEPTION: main Process: com.kaaryanext.raghukaka, PID: 16825 java.lang.NoClassDefFoundError: com.squareup.picasso.Picasso$1 at com.squareup.picasso.Picasso.(Picasso.java:109) at com.kaaryanext.raghukaka.listadapters.HomePageListAdapter$RecyclerAdapter.onBindViewHolder(HomePageListAdapter.java:132)
最佳答案
尝试下面的代码
public class MyApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
}
并在应用程序标签中的 android menifest 文件中添加以下行
android:name="your package name.MyApplication"
关于java - NoClassDefFoundError : com. squareup.picasso.Picasso 带电话,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36694726/
我一直在尝试在我的代码中使用 Jar 文件作为库,并且它编译得很好。但是,在运行时,我不断收到 NoClassDefFoundError信息。为什么会这样?我也在编译路径和运行时路径中包含了 Jar
关于Apache-Kafka messaging queue . 我已经从 Kafka 下载页面下载了 Apache Kafka。我已将其提取到 /opt/apache/installed/kafka
我正在尝试使用 Apache DefaultHttpClient 来执行 JSON POST 请求,当我尝试实例化它时它给我一个 NoClassDefFound 错误。 HttpClient clie
当我在模拟器(Nexus One API 22)上测试我的应用程序时,它运行顺利,没有失败。然而,当我在自己的个人手机(三星 Galaxy S5,Android 版本 5.0)上测试该应用程序时,它崩
我需要在python中使用java代码来减少,所以我选择了Jython。一段时间后,我设法弄清楚了如何运行我的代码,但我遇到了最奇怪的事情。当我写作时 from vohmm.corpus import
这是我的mybatis配置。这是我的pom.xml。。当我运行项目时,它显示了错误的原因:org/mybatis/spring/mapper/MapperScannerConfigurer.有没有人能
所以我正在尝试构建一个简单的gradle应用,当我运行它时, geb.ConfigurationLoader$UnableToLoadException: Unable to load configu
假设我有一个主类应用程序,它使用 URLClassLoader 加载子目录 plugins 中的所有 jar: public class App(){ public static void m
我在尝试运行 Netbeans (7.2) 时遇到一个反复出现的错误,上次遇到它时,我发现某个地方可以将所有文件移动到一个新项目。这可能会奏效,但我的项目的规模让这很麻烦。这是踪迹... Except
这个问题已经有答案了: Including all the jars in a directory within the Java classpath (25 个回答) 已关闭 6 年前。 我得到一个
在这里,我正在下载网页源代码,然后将其存储在文本文件中。然后我读取该文件并将其与正则表达式匹配以搜索特定字符串。 没有编译器错误。 Exception in thread "main" java.la
我正在一个“大”的 Maven/Java 项目中工作,无法理解运行应用程序时遇到的错误(它编译正常)。我得到的错误代码是: java.lang.NoClassDefFoundError: Could
对于学校的作业,我需要创建一个类 Blender 来实现一些预定义的东西。我收到了一个 JAR 文件 imagecompositor.jar,它可以完成所有操作并使用 Blender 类。 JAR 文
我遇到了一个问题,即抛出 NoClasDefFoundError。这让我感到困惑,因为我正在使用接口(interface),并且没有类定义应该可用。我已经阅读了一些指向类路径的帖子,但我不认为这是这里
我正在使用 hibernate,在使用 hibernate Connection 时出现如下错误 java.lang.NoClassDefFoundError: Could not initializ
我有一个使用 SubVersion 的 Android 项目。我使用 Subclipse 将项目导入我的 Eclipse Wordspace。 现在我有一个问题: java.lang.NoClass
我需要编译一个外部 java 文件(比如 a.java)。这是我为此编写的代码。 (字符串路径包含java和class文件的路径) command[0] = "javac"; comm
我正在尝试运行一个基本的 Hibernate 程序。当我运行它时,出现以下错误 java.lang.NoClassDefFoundError: org/jboss/logging/BasicLogge
标题:Eclipse插件开发由于java.lang.NoClassDefFoundError无法实例化类: 试图构建一个 eclipse 插件,但遇到一些运行时错误.. 我知道这是由于代码所依赖的类文
我是新手,我无法让它工作......:/ 我的 build.sbt: val apacheDeps = Seq( "commons-validator" % "commons-validator"
我是一名优秀的程序员,十分优秀!