android - 找不到 com.android.tools.build:gradle:3.0.1。在尝试构建 tensorflow lite 演示应用程序时
问题描述
我收到这个错误。我正在尝试构建 Tensorflow lite 演示应用程序,但它不工作。
找不到 com.android.tools.build:gradle:3.0.1。在以下位置搜索: https ://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom https://jcenter.bintray.com/com/android /tools/build/gradle/3.0.1/gradle-3.0.1.jar 要求:项目:打开文件
这是我的构建,gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "android.example.com.tflitecamerademo"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Remove this block.
jackOptions {
enabled true
}
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
aaptOptions {
noCompress "tflite"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
maven {
url 'https://google.bintray.com/tensorflow'
}
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-annotations:25.3.1'
compile 'com.android.support:support-v13:25.2.0'
compile 'org.tensorflow:tensorflow-lite:+'
testCompile 'junit:junit:4.12'
}
buildscript {
repositories {
google()
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
}
解决方案
请尝试更改classpath dependencies
如下
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'}
也请参考这个链接
谢谢你。
推荐阅读
- c# - Unity3D蓝牙串行馈送分配器问题C#
- rust - Rust 中的无符号整数溢出
- javascript - 使用 Firebase 云功能发送通知有困难吗?
- android - 片段 - 无法添加子视图,表示子视图已经有父视图
- python - Yield 关键字返回 0x107e4b3c0 而 Return 函数仅返回列表中的最后一个值
- html5-video - 默认 Html5 视频海报
- mysql - 如何写一个删除命令来替换三个sql?
- android - 在不同的机器上运行时,不变违规反应本机
- laravel - 服务器上的 Laravel 与 ip
- android - 如何在android中设置进度条0