1. 程式人生 > >Android Studio Error:Failed to resolve: :third-party-aar-name: Open File

Android Studio Error:Failed to resolve: :third-party-aar-name: Open File

android studio載入不了aar包問題處理
已經把aar包複製到了libs下,但問題如下:
這裡寫圖片描述

buidl.gradle配置:

repositories {
}
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile(name: 'xxx-debug', ext: 'aar')
    compile(name: 'xxx-sit-debug', ext: 'aar')
}

問題解決:
在repositories 新增flatDir { dirs ‘libs’ }表示工程要依賴libs開發:

repositories {
flatDir { dirs 'libs' }
}
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile(name: 'xxx-debug', ext: 'aar')
    compile(name: 'xxx-sit-debug', ext: 'aar')
}