一、首先依賴庫沒有在項目中settings.gradle 聲明
include ':app', ':common', ':easypermissions', ':statusbar', ':ninegridview'
二、依賴庫有問題
解決辦法:添加以來或者重新導入依賴庫
三、APP2 出錯
原因:file-build-glide 里面service有中文
第二種:gradle.properties的文件尾部添加android.enableAapt2=true
四、Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve 問題
解決方案:
1.android-studio File->Settings->Build, Execution, Deployment->Gradle->Uncheck Offline work option. 不要關閉更新按鈕
2.把這種依賴方式
debugCompile project(path: "CordovaLib", configuration: "debug") releaseCompile project(path: "CordovaLib", configuration: "release")
改成 implementation project(':CordovaLib')
五、
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestCompile('com.android.support:support-annotations:26.1.0') { force = true } }