Android项目重启后出现TintableImageSourceView类文件找不到错误
解决Android重启项目后出现的
cannot access TintableImageSourceView错误 问题背景
昨天还能正常编译运行的Android项目,今天关闭重新打开后突然抛出编译错误,具体报错信息如下:
error: cannot access TintableImageSourceView class file for android.support.v4.widget.TintableImageSourceView not found
报错指向我使用LottieAnimationView的这段代码:
LottieAnimationView animationView = (LottieAnimationView) dialog.findViewById(R.id.animation_view); // overlay = (RelativeLayout) dialog.findViewById(R.id.overlay); animationView.setImageAssetDelegate(new ImageAssetDelegate() { @Override public Bitmap fetchBitmap(LottieImageAsset asset) { AssetManager assetManager = context.getAssets(); InputStream istr; Bitmap bitmap = null; try { istr = assetManager.open(asset.getFileName()); bitmap = BitmapFactory.decodeStream(istr); } catch (IOException e) { // handle exception } return bitmap; } }); animationView.setAnimation("data.json"); animationView.loop(true);
尝试过的无效排查操作
在找到解决方案前,我已经试过以下常规修复手段,但都没有效果:
- 将Android Studio更新到最新版本
- 执行清除缓存并重启IDE(File → Invalidate Caches / Restart)
- 执行清理项目(Build → Clean Project)
最终有效解决方法
在上述操作都无效的情况下,我尝试了重启电脑,之后重新打开项目,编译错误直接消失,项目恢复正常运行。
附项目app模块的build.gradle配置
buildscript { repositories { maven { url 'https://plugins.gradle.org/m2/'} } dependencies { classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1' } } apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin' repositories { maven { url 'https://maven.google.com' } } apply plugin: 'com.android.application' android { signingConfigs { config { keyAlias '...' keyPassword '...' storeFile file('...') storePassword '...' } } compileSdkVersion 25 buildToolsVersion "26.0.2" defaultConfig { applicationId "ymz.yma.setareitsim_seller" minSdkVersion 19 targetSdkVersion 25 versionCode 5 versionName "1.0" manifestPlaceholders = [onesignal_app_id : "...", onesignal_google_project_number: "REMOTE"] } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' debuggable true signingConfig signingConfigs.config } debug{ signingConfig signingConfigs.config } } } dependencies { compile 'com.android.support:appcompat-v7:25.4.0' compile 'com.android.support:support-v4:25.4.0' compile 'com.wrapp.floatlabelededittext:library:0.0.6' compile 'com.daimajia.easing:library:2.1@aar' compile 'com.daimajia.androidanimations:library:2.3@aar' compile 'com.truizlop.fabreveallayout:library:1.0.0' // compile 'com.bartoszlipinski.flippablestackview:library:1.2.1' compile 'de.hdodenhof:circleimageview:2.1.0' compile 'com.ramotion.foldingcell:folding-cell:1.2.1' compile 'com.android.support:design:25.4.0' compile 'com.mikhaellopez:circularprogressbar:1.1.1' compile 'com.github.zcweng:switch-button:0.0.3@aar' compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4' compile 'com.roger.psdloadingview.library:Library:1.0.1' compile 'jp.wasabeef:blurry:2.1.1' compile 'com.orhanobut:dialogplus:1.11@aar' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson:2.3.0' compile 'com.google.code.gson:gson:2.8.2' compile 'com.airbnb.android:lottie:2.1.0' compile 'com.github.takusemba:spotlight:1.1.3' compile('com.github.badoualy:stepper-indicator:1.0.7') { exclude group: 'com.android.support' } compile('com.github.ganfra:material-spinner:2.0.0') { exclude group: 'com.android.support' } compile 'me.gujun.android.taggroup:library:1.4@aar' compile('com.alibaba.android:ultraviewpager:1.0.6.1@aar') { transitive = true } implementation 'com.squareup.okhttp3:okhttp:3.9.1' compile 'com.orhanobut:hawk:2.0.1' compile 'com.github.jorgecastilloprz:fabprogresscircle:1.01@aar' compile 'com.theartofdev.edmodo:android-image-cropper:2.4.7' compile 'com.onesignal:OneSignal:[3.8.3, 3.99.99]' compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.+' implementation 'com.github.bumptech.glide:glide:4.6.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' compile 'com.github.iwgang:countdownview:2.1.6' // compile 'nl.psdcompany:duo-navigation-drawer:2.0.7' implementation project(':sep') }
内容的提问来源于stack exchange,提问作者peter
相关产品推荐
相关产品推荐

