- 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/
Picasso.with(context).load("url").into(imageView); 在这里,我想要位图而不是 url,我该如何实现这一点。 像下面- Picasso.with(con
我在运行低于 API 版本 21 的手机上遇到 noClassDefFoundError。首先它与其他类一起出现,在删除所有可能的代码后,它开始与 Picasso 库一起出现。我附上了我的 logca
在 Picasso.with(context) .. public static Picasso with(Context context) { if (singleton == null) {
我第一次尝试使用Picasso 如官方网站示例: private void setItemBgImageUsingPicasso(View convertView) { String imag
我添加了 picasso 依赖项,但似乎没有用。我尝试更改版本。但还是没用。 这是我的 build.gradle(模块) apply plugin: 'com.android.application'
我想用 com.squareup.picasso:picasso:2.5.3-SNAPSHOT 编译。但是我得到了这个错误: Error:Could not find com.squareup.pic
我只在 Lollipop 版本上遇到过这个问题。我可以在 Lollipop 以上的版本上轻松运行该应用程序。当我在我的应用程序文件中运行该应用程序时出现错误: java.lang.NoClass
它在 Gradle build 和 Compile time 都没有给出任何错误消息,但是当我运行应用程序时它崩溃并给我以下错误消息。 Caused by: java.lang.ClassNotFou
在 android studio 中,Gradle 项目无法同步并导致此错误。 Error:(29, 13) Failed to resolve: com.squareup.picasso:picas
首先我知道这个错误是asked已经,但我的情况有点不同: 我正在分发 SDK(Android 库项目)。我的 SDK 需要其他东西(播放服务、支持 v4、gson jar 等)Picasso,所以我在
我认为这是一个库兼容性问题,但值得一试。 我正在尝试在我的应用程序中实现图像 slider ,但 Picasso 库出现了异常,它给了我 noSuchMethodError。 好吧,我连接两个字符串,
我对此非常绝望。问题是 picasso 只显示占位符图标。 我的 FirebaseStorageRefernce 代码看起来像这样引用 Firebase Blog post : StorageRef
我们正在使用Picasso加载应用程序中的所有图像,从小型化身到大型全屏图像,每10个每日事件用户中就会出现1个此类错误。 picasso 缓存已满,但据我们了解,它应该自行维护。 我们的日志表明,在
在我的函数中: public void getPointMarkerFromUrl(final String url, final OnBitmapDescriptorRetrievedListene
我正在尝试使用 Picasso 库加载矢量绘图 Picasso.get().load(R.drawable.project).into(image3a, new Callback() {
出于某种原因,每当我尝试将从 GET 请求获取的 URL 加载到服务器时,它都不会加载,但如果我尝试直接加载字符串,它就会工作。这是我的代码: new Thread(new Runnable() {
我在使用 picasso 库时遇到问题。当我使用此库(implementation 'com.squareup.picasso:picasso:2.71828')时,我的图像不会显示在 ImageVi
我使用 Picasso 库从 URL 加载图像。我想获得真实的图像大小,但我只能获得内存中的图像大小: Picasso.with(this) .load(imageUrl) .erro
我正在尝试在我的 gradle-android 项目中使用 Picasso 库。我正在使用 Eclipse IDE。当我对我的项目进行 gradle 构建时,构建正确,但在使用 Picasso 的 *
我遇到了一个问题,即在不同版本的 Android(KitKat 和 Marshmellow)上的某些设备(非 Nexus 设备)上,当我尝试使用 picasso 将图像加载到 ImageView 中时
我是一名优秀的程序员,十分优秀!