i created a new project and didn't modify any files.
i just run the mobile module after the project was created.
The error message is:
Error:Execution failed for task ':mobile:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\Administrator\AndroidStudioProjects\InTheLeft\mobile\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar (can't find this path)
there is build.gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "ooo.zuo.intheleft"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
}
At first Upgrade SDK Manager .
java.io.FileNotFoundException:
C:\Users\Administrator\AndroidStudioProjects\InTheLeft\mobile\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar
(can't find this path)
This exception is thrown during a failed attempt to open the file denoted by a specified pathname.
What is your classpath ??
You can use
compile 'com.google.android.gms:play-services:8.3.0'
&
Use this
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
Then Clean-Rebuild Your Project .
Related
I need help because i build this project(from udacity course of android beginner)
its ok but when i clean it and reopen it shows an error related to my theme used. Please any help would be appreciated.
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.android.scorekeeper"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
}
Find the below lines in app/build.gradle file
compile 'com.android.support:appcompat-v7:23.3.0' // ensure this line is present
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
I am trying to import two jar files to my Android Studio Project. But when i try to run the code. I get the following Error.
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate
files copied in APK META-INF/ECLIPSE_.RSA
File1: A:\Uni-mora-sem4\IOT\Project\ClientApp\AndroidClientV2\app\libs
\org.eclipse.paho.android.service-1.0.2.jar
File2: A:\Uni-mora-sem4\IOT\Project\ClientApp\AndroidClientV2\app\libs\org.eclipse.paho.client.mqttv3-1.0.2.jar
Gradle File is as Follows.........
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "iot.dulanga.com.androidclientv2"
minSdkVersion 13
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://repo.eclipse.org/content/repositories/paho-releases/"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile files('libs/org.eclipse.paho.android.service-1.0.2.jar')
compile files('libs/org.eclipse.paho.client.mqttv3-1.0.2.jar')
}
Any ideas why I get this error ??
This is because both the jars are containing META-INF/ECLIPSE_.RSA and thus while packing the apk, duplication is arising.
So try to add this in the app's build.gradle:
android {
packagingOptions {
exclude 'META-INF/ECLIPSE_.RSA'
}
}
After creating a new project when I try to run the app it shows build failed error.
I searched for it on the internet, they say that it may be due to duplicate libraries of gradle or duplicate dependencies in gradle file, but it wasn't so In my case.
Here is my build.gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.naveenjain.ayusch"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
Try to delete this line:
compile fileTree(dir: 'libs', include: ['*.jar'])
Or you could set multiDexEnabled true:
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
and try again. Hope it helps.
Can't build project with Dagger 2 (Android Studio 1.3).
Step 1. Add dependencies to build.gradle
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
provided 'org.glassfish:javax.annotation:10.0-b28'
Full build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:22.2.+'
compile 'com.android.support:palette-v7:22.2.+'
compile 'com.afollestad:material-dialogs:0.7.8.1'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
compile 'org.androidannotations:androidannotations:3.0.+'
compile 'org.androidannotations:androidannotations-api:3.0.+'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile files('libs/gson-2.2.jar')
}
Step 2.
Just add annotation #Inject or #Module to code and get compile error.
Error:Execution failed for task ':app:compileDebugJava'.
java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.filterKeys(Lcom/google/common/collect/SetMultimap;Lcom/google/common/base/Predicate;)Lcom/google/common/collect/SetMultimap;
Any ideas?
Update
I'm create new project.
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile files('libs/gson-2.2.jar')
}
And it compile fine. When I add to libs guava-r07.jar I get like compile error. I think the problem relate with guava.
Solved
Remove guava-r07.jar from libs.
Add to build.gradle
compile 'com.google.guava:guava:13.0.1'
I add a library to my project,but the library has some jar packages that i have used in my app,so it comes out the error "finished with non-zero value 2",after i modify the jar packages version,it comes out the error "Error:Execution failed for task ':app:preDexDebug'. > ... finished with non-zero value 1",i dont konw how to solve it 。
the app buidle.gradle :
`apply plugin: 'com.android.application'
android {
packagingOptions{
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
abortOnError false
}
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.fengmanlou.logintest"
minSdkVersion 14
targetSdkVersion 21
versionCode 2
versionName "2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:22.0.0'
compile project(':slibingtab')
compile project(':leanchatlib')
compile files('libs/weibo.sdk.android.sso.jar')
compile files('libs/Java-WebSocket-1.2.0-leancloud.jar')
compile files('libs/qq.sdk.1.6.1.jar')
compile files('libs/httpmime-4.2.4.jar')
compile files('libs/fastjson-1.1.37-leancloud.jar')
compile files('libs/avoscloud-statistics-v3.1.1.jar')
compile files('libs/avoscloud-sdk-v3.1.4.jar')
compile files('libs/avoscloud-push-v3.1.4.jar')
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/android_api_1.1_forsdk.jar')
compile files('libs/BaiduLBS_Android.jar')
compile files('libs/galaxy_mini.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile files('libs/avoscloud-sns-v3.1.1.jar')
compile files('libs/avoscloud-search-v3.1.1.jar')
compile files('libs/weibosdkcore.jar')
compile files('libs/litepal.xml-1.2.0.jar')
compile project(':pulltorefresh')
compile files('libs/avoscloud-feedback-v3.1.1.jar')
compile files('libs/jsoup-1.8.1.jar')
compile project(':slibingmenu')
} `
the library build.gradle :
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:22.0.0'
compile files('libs/android-async-http-1.4.6.jar')
compile files('libs/avoscloud-push-v3.1.4.jar')
compile files('libs/avoscloud-sdk-v3.1.4.jar')
compile files('libs/butterknife-6.1.0.jar')
compile files('libs/eventbus-2.4.0.jar')
compile files('libs/fastjson-1.1.37-leancloud.jar')
compile files('libs/httpmime-4.2.4.jar')
compile files('libs/Java-WebSocket-1.2.0-leancloud.jar')
compile files('libs/prettytime-3.2.5.Final.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
}
this is the first time i use stackoverflow to ash question,please tell me how to solve it .thank you!
I also dont know how to solve the problem.but the project is built successfully.There is a jar package that cant be opened. I delete it and add the jar package from other project.it works.