Could not find com.android.tools.build:aapt2:3.3.1-5013011.
Could not find com.android.tools.build:aapt2:3.3.1-5013011.
Searched in the following locations:
- file:/E:/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
- file:/E:/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
- file:/E:/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
- file:/E:/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
- file:/E:/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
- file:/E:/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
- https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011.pom
- https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.1-5013011/aapt2-3.3.1-5013011-windows.jar
Required by:
project :app
原因是AS版本升3.0後會報這個錯
在你的bulid.gradle文件裏面添加google()這句話
加入位置:Android大括號內
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
defaultConfig {
applicationId "com.will.bluetoothprinterdemo"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
allprojects {
repositories {
jcenter()
google()//新增這一行
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.github.promeg:tinypinyin:1.0.0'
testImplementation 'junit:junit:4.12'
}