apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
defaultConfig {
applicationId "com.example.takeimage"
minSdkVersion 19
targetSdkVersion 23
}
android {
packagingOptions {
exclude 'META-INF/NOTICE'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
compile 'com.fasterxml.jackson.core:jackson-databind:2.4.2'
compile 'org.glassfish.main:javax.annotation:4.0-b33'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:23.1.1'
}
-
这是我项目的My Build.Gradle文件 .
-
这里我正在尝试使用gradle build从ubuntu终端生成apk文件 .
-
但是Gradle Build失败了........
-
我没有Android Studio
-
我只有Android sdk .
-
我的主要任务是生成apk文件,不启动android studio .
-
来自终端
-
./gradlw使用此cmd汇编调试 .
-
这是我的日志........
- 出了什么问题:配置项目':app'时出现问题 .
无法解析配置':app:_debugCompile'的所有依赖项 . 找不到com.android.support:design:23.1.1 . 在以下位置搜索:https://jcenter.bintray.com/com/android/support/design/23.1.1/design-23.1.1.pom https://jcenter.bintray.com/com/android/support /design/23.1.1/design-23.1.1.jar https://repo1.maven.org/maven2/com/android/support/design/23.1.1/design-23.1.1.pom https:// repo1 .maven.org / maven2 / com / android / support / design / 23.1.1 / design-23.1.1.jar http://repo.spring.io/milestone/com/android/support/design/23.1.1/ design-23.1.1.pom http://repo.spring.io/milestone/com/android/support/design/23.1.1/design-23.1.1.jar要求:Android:app:unspecified无法找到com .android.support:程序兼容性-V7:23.1.1 . 在以下位置搜索:https://jcenter.bintray.com/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.pom https://jcenter.bintray.com/com /android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar https://repo1.maven.org/maven2/com/android/support/appcompat-v7/23.1.1/appcompat- v7-23.1.1.pom https://repo1.maven.org/maven2/com/android/support/appcompat-v7/23.1.1/appcompat-v7-23.1.1.jar http://repo.spring . io / milestone / com / android / support / appcompat-v7 / 23.1.1 / appcompat-v7-23.1.1.pom http://repo.spring.io/milestone/com/android/support/appcompat-v7/23.1 .1 / appcompat-v7-23.1.1.jar要求:Android:app:unspecified无法找到com.android.support:recyclerview-v7:23.1.1 . 在以下位置搜索:https://jcenter.bintray.com/com/android/support/recyclerview-v7/23.1.1/recyclerview-v7-23.1.1.pom https://jcenter.bintray.com/com /android/support/recyclerview-v7/23.1.1/recyclerview-v7-23.1.1.jar https://repo1.maven.org/maven2/com/android/support/recyclerview-v7/23.1.1/recyclerview- v7-23.1.1.pom https://repo1.maven.org/maven2/com/android/support/recyclerview-v7/23.1.1/recyclerview-v7-23.1.1.jar http://repo.spring . io / milestone / com / android / support / recyclerview-v7 / 23.1.1 / recyclerview-v7-23.1.1.pom http://repo.spring.io/milestone/com/android/support/recyclerview-v7/23.1 .1 / recyclerview-v7-23.1.1.jar要求:Android:app:unspecified无法找到com.google.android.gms:play-services-base:8.4.0 . 在以下位置搜索:https://jcenter.bintray.com/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.pom https:// jcenter .bintray.com / com / google / android / gms / play-services-base / 8.4.0 / play-services-base-8.4.0.jar https://repo1.maven.org/maven2/com/google/ android / gms / play-services-base / 8.4.0 / play-services-base-8.4.0.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services-base /8.4.0/play-services-base-8.4.0.jar http://repo.spring.io/milestone/com/google/android/gms/play-services-base/8.4.0/play-services- base-8.4.0.pom http://repo.spring.io/milestone/com/google/android/gms/play-services-base/8.4.0/play-services-base-8.4.0.jar要求:Android:app:unspecified无法找到com.google.android.gms:play-services-plus:8.4.0 . 在以下位置搜索:https://jcenter.bintray.com/com/google/android/gms/play-services-plus/8.4.0/play-services-plus-8.4.0.pom https:// jcenter .bintray.com / com / google / android / gms / play-services-plus / 8.4.0 / play-services-plus-8.4.0.jar https://repo1.maven.org/maven2/com/google/ android / gms / play-services-plus / 8.4.0 / play-services-plus-8.4.0.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services-plus /8.4.0/play-services-plus-8.4.0.jar http://repo.spring.io/milestone/com/google/android/gms/play-services-plus/8.4.0/play-services-加上8.4.0.pom http://repo.spring.io/milestone/com/google/android/gms/play-services-plus/8.4.0/play-services-plus-8.4.0.jar要求:Android:app:unspecified无法找到com.google.android.gms:play-services-auth:8.4.0 . 在以下位置搜索:https://jcenter.bintray.com/com/google/android/gms/play-services-auth/8.4.0/play-services-auth-8.4.0.pomhttps://jcenter.bintray.com/com/google/android/gms/play-services-auth/8.4.0/play-services-auth-8.4.0.jar https://repo1.maven.org/maven2 /com/google/android/gms/play-services-auth/8.4.0/play-services-auth-8.4.0.pom https://repo1.maven.org/maven2/com/google/android/gms/ play-services-auth / 8.4.0 / play-services-auth-8.4.0.jar http://repo.spring.io/milestone/com/google/android/gms/play-services-auth/8.4.0 /play-services-auth-8.4.0.pom http://repo.spring.io/milestone/com/google/android/gms/play-services-auth/8.4.0/play-services-auth-8.4 . 0.jar要求:Android:app:unspecified无法找到com.android.support:support-v13:23.1.1 . 在以下位置搜索:https://jcenter.bintray.com/com/android/support/support-v13/23.1.1/support-v13-23.1.1.pom https://jcenter.bintray.com/com /android/support/support-v13/23.1.1/support-v13-23.1.1.jar https://repo1.maven.org/maven2/com/android/support/support-v13/23.1.1/support- v13-23.1.1.pom https://repo1.maven.org/maven2/com/android/support/support-v13/23.1.1/support-v13-23.1.1.jar http://repo.spring . io / milestone / com / android / support / support-v13 / 23.1.1 / support-v13-23.1.1.pom http://repo.spring.io/milestone/com/android/support/support-v13/23.1 .1 / support-v13-23.1.1.jar要求:Android:app:unspecified无法找到com.google.android.gms:play-services-appindexing:8.4.0 . 在以下位置搜索:https://jcenter.bintray.com/com/google/android/gms/play-services-appindexing/8.4.0/play-services-appindexing-8.4.0.pom https:// jcenter .bintray.com / com / google / android / gms / play-services-appindexing / 8.4.0 / play-services-appindexing-8.4.0.jar https://repo1.maven.org/maven2/com/google/ android / gms / play-services-appindexing / 8.4.0 / play-services-appindexing-8.4.0.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services-appindexing /8.4.0/play-services-appindexing-8.4.0.jar http://repo.spring.io/milestone/com/google/android/gms/play-services-appindexing/8.4.0/play-services- appindexing-8.4.0.pom http://repo.spring.io/milestone/com/google/android/gms/play-services-appindexing/8.4.0/play-services-appindexing-8.4.0.jar要求:Android:app:unspecified无法找到com.google.android.gms:play-services-gcm:8.4.0 . 在以下位置搜索:https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/8.4.0/play-services-gcm-8.4.0.pom https:// jcenter .bintray.com / com / google / android / gms / play-services-gcm / 8.4.0 / play-services-gcm-8.4.0.jar https://repo1.maven.org/maven2/com/google/ android / gms / play-services-gcm / 8.4.0 / play-services-gcm-8.4.0.pom https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm /8.4.0/play-services-gcm-8.4.0.jar http://repo.spring.io/milestone/com/google/android/gms/play-services-gcm/8.4.0/play-services- gcm-8.4.0.pom http://repo.spring.io/milestone/com/google/android/gms/play-services-gcm/8.4.0/play-services-gcm-8.4.0.jar要求:Android:app:unspecified无法找到com.android.support:support-v4:[22,23的任何匹配项,因为没有com.android.support:support-v4版本可用 . 在以下位置搜索:https://jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml https://jcenter.bintray.com/com/android/support/support-v4 / https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml https://repo1.maven.org/maven2/com/android/support/support-v4/ http://repo.spring.io/milestone/com/android/support/support-v4/maven-metadata.xml http://repo.spring.io/milestone/com/android/support/support-v4/必填作者:Android:app:unspecified> com.facebook.android:facebook-android-sdk:4.6.0
- 尝试:使用--stacktrace选项运行以获取堆栈跟踪 . 使用--info或--debug选项运行以获取更多日志输出 .
建筑失败
-
任何人都可以帮我解决这个问题 .
-
我非常感谢你.........
3 回答
您没有在SDK Manager中安装Android Repository和Google Repository,或者它们不是最新的更新 .
很可能你有一个64位系统,但仍然有一些32位缺少Android开发 .
如果您在64位Ubuntu系统上运行,请参阅Ubuntu 64位Android开发的32位库以获取更多详细信息 .
如果您在64位Fedora系统上运行,请参阅安装-android-sdk-on-64-bit-fedora /以获取更多详细信息 .
为了让aapt工作(这也修复了我对avd的问题),只需运行以下两个命令:sudo apt-get install lib32stdc 6 sudo apt-get install lib32z1
看起来像你需要一些本地支持库 . 你试过从终端运行一次吗?