当我尝试在Android Studio模拟器中启动我的应用程序时 我收到此错误:
Could not find com.android.tools.build:aapt2:3.3.2-5309881.
Searched in the following locations:
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881.pom
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881-windows.jar
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881.pom
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881-windows.jar
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881.pom
- file:/C:/Users/jalal/AppData/Local/Android/Sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881-windows.jar
- https://jitpack.io/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881.pom
- https://jitpack.io/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881-windows.jar
- https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881.pom
- https://jcenter.bintray.com/com/android/tools/build/aapt2/3.3.2-5309881/aapt2-3.3.2-5309881-windows.jar
Required by:
project :app
答案 0 :(得分:26)
在 build.gradle
中添加 google()func mapView(_ mapView: MGLMapView, viewFor annotation: MGLAnnotation) -> MGLAnnotationView? {
答案 1 :(得分:8)
我必须在两个地方添加google()
来解决这个问题
路径为<applicationName>\build.gradle
。请注意,还有一个不应与-<applicationName>\app\build.gradle
混淆。
1。
buildscript {
repositories {
jcenter()
google()
}
....
}
2。
allprojects {
repositories {
jcenter()
google()
}
}
答案 2 :(得分:2)
嗨,我已经解决了..在项目目录中
android> build.gradle
classpath 'com.android.tools.build:gradle:3.0.1'
android> app> build.gradle
android {
buildToolsVersion "28.0.3"
}