我已经在这个Android项目上工作了大约一年了,突然我昨天打开它时Android Studio 3.1.2无法同步gradle并且项目不再构建给我这个错误:
Could not find support-core-ui.jar (com.android.support:support-core-ui:27.1.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-core-ui/27.1.1/support-core-ui-27.1.1.jar
Please install the Android Support Repository from the Android SDK Manager.
Open Android SDK Manager
Run Code Online (Sandbox Code Playgroud)
我很确定Android支持存储库已正确安装,因为它在其他项目中成功运行,而我所有其他项目都正常运行,没有任何问题.
我在app模块中有这个gradle文件:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.21.5'
}
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'realm-android'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion …Run Code Online (Sandbox Code Playgroud) android gradle android-support-library build.gradle android-gradle-plugin
Gradle终端(也称为Gradle命令行)没有在我的android工作室中显示,我有android studio版本1.3.1,我一直在寻找如何查看终端超过一个小时现在我得到的是关于如何使用它而不是如何显示它所以我最终可以使用它.有人为此得到了解决方案吗?提前致谢.
terminal android gradle android-studio android-gradle-plugin
我有一个Android Studio项目在Android版本Lollipop的设备上正常工作,但是在尝试使用Android构建版本Kitkat的设备上运行它时会抛出异常.这是我的项目的build.gradle文件:
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
multiDexEnabled true
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/org.apache.commons.io.jar')
compile files('libs/commons-codec-1.10.jar')
compile('com.twitter.sdk.android:twitter:1.6.0@aar') {
transitive = true;
}
compile files('libs/pinit-sdk-1.0.jar')
compile project(':bounceScroller')
compile 'com.ogaclejapan.smarttablayout:library:1.2.1@aar'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.android.support:appcompat-v7:21.2.0'
compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
compile 'com.nineoldandroids:library:2.4.+'
compile 'com.esri.arcgis.android:arcgis-android:10.2.6-2'
compile 'com.github.clans:fab:1.5.3'
compile 'com.github.pedrovgs:draggablepanel:1.8'
compile 'com.android.support:support-v4:21.2.0'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.2.1@aar'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile project(':rangeseekbar')
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile project(':blurry')
compile 'com.google.android.gms:play-services:7.8.0'
} …Run Code Online (Sandbox Code Playgroud) 我有一个奇怪的例外,在我添加一些资源到我的Android项目之后突然出现了.该应用程序完全停止构建并抛出以下异常:
Error:Execution failed for task
':app:transformClassesWithJarMergingForEliteDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/design/widget/CoordinatorLayout$1.class
Run Code Online (Sandbox Code Playgroud)
我之前遇到过同样的异常,但是我有一个不同的类,我立即修复它但现在的事情是我不知道副本在哪里,我找不到任何人在SO上有相同的重复异常.
我尝试support-v4从所有其他库中排除,我也在multidex我的项目中启用但似乎没有解决问题所以我想你们中的一些人可能对此有一些见解以及为什么它突然发生而没有改变我build.gradle文件中的任何内容,因为它工作完美好之前.
我build.gradle的内容如下:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'realm-android'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 16
targetSdkVersion 26
versionCode 27
versionName "2.2.4"
multiDexEnabled true
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v4'
}
buildTypes { …Run Code Online (Sandbox Code Playgroud)