Reputation: 83
I am trying to create a new sample app in Android Studio 2.0. When I try to Run or debug it shows a compile time error like,
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: D:\Android Studio\newapp\app\libs\core.jar (The system cannot find the file specified)
I had tried by giving path JAVA_HOME C:\Program Files\Java\jdk1.7.0_45 and Sync project with gradle.
This is My Gradle
android { compileSdkVersion 23 buildToolsVersion "23.0.1" useLibrary 'org.apache.http.legacy' ... }
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1-alpha2'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:design:23.0.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'com.google.android.gms:play-services:+'
compile 'org.apache.httpcomponents:httpclient:4.2.6'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile files('libs/core.jar')
}
Even after that I cant find any solution.
Thank You in advance
Upvotes: 3
Views: 7445
Reputation: 191963
libs\core.jar (The system cannot find the file specified)
Seems like an obvious error to me...
Remove this line. You don't need it
compile files('libs/core.jar')
You could add a core.jar
file into the libs folder, but you still wouldn't need that line since you are already compiling it
Also, pick only one version, please. You don't need to add them multiple times
compile 'com.android.support:appcompat-v7:23.0.1-alpha2'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.2.0'
Same for these
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:design:23.0.1'
Upvotes: 5