赞
踩
implementation('com.github.bumptech.glide:glide:4.9.0') {
}
或者
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'jp.wasabeef:glide-transformations:4.0.0'
java.lang.IllegalStateException: GeneratedAppGlideModuleImpl is implemented incorrectly.
If you've manually implemented this class, remove your implementation.
The Annotation processor will generate a correct implementation.
区别于Glide 4.10之前的版本,4.10(包括4.10)以上的版本需要一些其他配置。
是将4.10以上的版本降至4.8或者4.9
配置 AppGlideModule
第一步,自定义AppGlideModule
@GlideModule
public class CustomGlideModule extends AppGlideModule {
@Override
public boolean isManifestParsingEnabled() {
return false;
}
}
第二步,设置自定义AppGlideModule
<meta-data
android:name="com.zjb.glide.CustomGlideModule"
android:value="AppGlideModule"/>
与Activity同级,设置在Manifest.xml中。
################glide 4.10 之前的混淆############### #-keep public class * implements com.bumptech.glide.module.AppGlideModule #-keep public class * implements com.bumptech.glide.module.LibraryGlideModule #-keep class com.bumptech.glide.** { *; } #-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** { # **[] $VALUES; # public *; #} # Glide 4.10 及以后 -keep public class * implements com.bumptech.glide.module.GlideModule -keep public class * extends com.bumptech.glide.module.AppGlideModule -keep public enum com.bumptech.glide.load.ImageHeaderParser$** { **[] $VALUES; public *; }
https://github.com/JessYanCoding/MVPArms/issues/344
问题解决参考:Glide笔记(一)AppGlideModule
更多AppGlideModule的自定义配置,可以移步:https://github.com/JessYanCoding/MVPArms
Android 10.0 , targetSdk 29
从Android Q(即 Android 10)开始,应用访问外部存储的私有目录(即Context.getExternalFilesDir())不需要申请READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE权限。
同时,正常情况下,就算应用有申请READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE权限,也只能访问外部存储的私有目录,若是访问了除了私有目录之外的其他外部储存,会抛出FileNotFoundException异常。
<application
android:requestLegacyExternalStorage="true"
android:name=".CustomApplication"
android:allowBackup="true"
android:icon="@mipmap/icon_app"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppStartLoadBackgroud"
tools:replace="android:allowBackup,android:name,android:theme">
...
添加下面这句
android:requestLegacyExternalStorage="true"
这样就不会执行分区存储了。
Android 11 强制执行分区存储,需要使用应用自己的存储路径,想修改这个问题,就要修改路径。
More than one file was found with OS independent path ‘lib/armeabi-v7a/libRSSupport.so‘
来自 Gldie 和 AAR的冲突。
以下图片转载自:https://www.jianshu.com/p/8c9a41d1c566
在工程APP下添加如下代码即可
packagingOptions {
pickFirst 'lib/armeabi-v7a/libRSSupport.so'
pickFirst 'lib/arm64-v8a/librsjni.so'
pickFirst 'lib/x86_64/librsjni_androidx.so'
pickFirst 'lib/arm64-v8a/libRSSupport.so'
pickFirst 'lib/armeabi-v7a/librsjni_androidx.so'
pickFirst 'lib/x86_64/libRSSupport.so'
pickFirst 'lib/x86/librsjni.so'
pickFirst 'lib/x86_64/librsjni.so'
pickFirst 'lib/x86/librsjni_androidx.so'
pickFirst 'lib/armeabi-v7a/librsjni.so'
pickFirst 'lib/x86/libRSSupport.so'
pickFirst 'lib/arm64-v8a/librsjni_androidx.so'
}
More than one file was found with OS independent path ‘lib/armeabi-v7a/libRSSupport.so’
https://blog.csdn.net/shenggaofei/article/details/105214410
More than one file was found with OS independent path ‘lib/armeabi-v7a/libdemo-lib.so’:https://www.jianshu.com/p/8c9a41d1c566
使用Glide后,需要先 ↓
Glide.with(this).clear(photo);
再调用setImageResource/setImageDrawable
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。