Recently I have updated the Android Studio and also the SDK.
While rebuilding my app project i m getting following error...
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:appcompat-v7:23.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
file:/C:/android new SDK/extras/android/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
file:/C:/android new SDK/extras/android/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
file:/C:/android new SDK/extras/google/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
file:/C:/android new SDK/extras/google/m2repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
Required by:
AppOne:app:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.913 secs
...............................................................
My Gradle file config is as follows ..
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 9
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'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
Take android sdk manager and update
Android support Library
Android support Repository
It will fix the problem.
You need to install/Update the Android support Library and Android support Repository first and then rebuild the project.
Related
I've converted an Eclipse project for AndroidStudio then I got some errors "package does not exits", it package is library module.
library project's gradle scripts as follows.
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
debug {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile 'com.android.support:support-v4:22.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
}
and the project's gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "xxxxxxxxxxxxxxxxx"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
}
debug {
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.android.support:support-v4:23.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile project(':library')
}
It's weird because IDE does not show any errors while coding and can import package properly but when I try to "run" the project, then error occurs.
I would appreciate it if someone could solve this problem.
Edited
Project Structure is like below.
- app (com.sample.apps)
- library (com.sample.library)
Actual Error Messages
package com.sample.library.xxx does not exits // <- My Custom Class. There are hundreds of errors.
Gradle Errors
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
100 errors
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.344 secs
Solved
I solved this by using product flavors.
This is because library project is going to apply proguard and that's why application project can't find package.
I changed 'com:android:library' to 'com:android:application' and move app project as product flavors.
Pleas help with this error cause it's my first android project !
Gradle Sync:
pply plugin: 'com.android.application'
android {
compileSdkVersion 8
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.interceptor.myapplication"
minSdkVersion 5
targetSdkVersion 8
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:8.0.+'
}
On Gradle console i get:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find any version that matches com.android.support:appcompat-v7:8.0.+.
Versions that do not match:
24.0.0-alpha1
23.2.1
23.2.0
23.1.1
23.1.0
+ 14 more
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/appcompat-v7/
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/maven-metadata.xml
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/maven-metadata.xml
file:/D:/Users/INTERCEPTOR/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/
Required by:
MyApplication:app:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
You should use the correct version for the appcompat-v7 dependency.
The latest stable version of the above-mentioned dependency to now is:
compile 'com.android.support:appcompat-v7:23.2.1'
Use it as above and make sure you installed/updated to the latest version in SDK Manager before.
I am new to Android,i installed Android Studio 1.4.1 ,i am getting following errors.how may i resolve these error?
Gradle Sync
Error:(24, 13) Failed to resolve: com.android.support:appcompat-v7:20.+
Install Repository and sync project<br>Show in File<br>Show in Project Structure dialog
Gradle Build
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find any matches for com.android.support:appcompat-v7:20.+ as no versions of com.android.support:appcompat-v7 are available.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/appcompat-v7/
Required by:
MyFirstApp:app:unspecified
Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.admin.myfirstapp"
minSdkVersion 15
targetSdkVersion 20
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:20.+'
}
Are you behind a firewall? You might need to do this in the project build.gradle:
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
I had the same problem, my problem was that the user running studio android did not have permissions to affect the root directory of android. In my case I gave permissions to that directory with the command:
chdown -R myuser /opt/android-studio/
Everybody, im trying to generate a signed APK file , with android studio, Firts of all, I changed the "Build variant" from debug to release, then on grade.app minifyEnabled i put true, finally I created my Key and my password, and everything is alright until here, but on my last click, Android studio trys to generate the file but this message comes out
Warning: com.google.android.gms.auth.GoogleAuthUtil: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: there were 1 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:proguardRelease'.
java.io.IOException: Please correct the above warnings first.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
im too new with this software , so please be patient with me, i dont know which libraries should i Update.
My compileSdkVersion is 23, and my targed sdk version is 23.
Thanks you all of you.
here is my build.grade file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.manuelrios.aplicacion_inmobiliaria"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.google.android.gms:play-services:4.2.42'
}
Add the below code in your app gradle
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
.
.
.
lintOptions {
checkReleaseBuilds false
}
}
I'm trying to continue working on an older project of mine, it's about a year old, and was working fine back then, but now after that I've updated AndroidStudio, it can't even build anymore.
I'm getting an error saying that I've got the same dex file twice:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
To fix this, I could simply do 'gradle dependencies' to find the culprit, and exclude the faulty file(s), but this is where I run into my actual problem.
When I do 'gradle dependencies', I get the following error:
FAILURE: Build failed with an exception.
* Where:
Build file 'F:\Github\Coinbook\app\build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not create plugin of type 'AppPlugin'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
And here is my full build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.moonrain.coinbook"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "0.7"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile project(':libs:AndroidBootstrap')
compile files('libs/socialauth-4.4.jar')
compile files('libs/socialauth-android-3.2.jar')
compile 'com.doomonafireball.betterpickers:library:1.5.2'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.github.castorflex.smoothprogressbar:library:1.0.0'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.readystatesoftware.systembartint:systembartint:1.0.4'
compile 'com.google.code.gson:gson:2.3'
}
So this is were I'm basically stuck at the moment, I've tried the following to fix the issue:
- Updated AndroidStudio
- Updated all SDK related items
- Updated gradle
- Re-created the entire project in a new folder, then copied over my files to the new project
Each post I find regarding this issue, it says to use Gradle 0.7.3 Instead of 0.7.2 Because of a bug.. But that's like a year old, and no longer valid.
Try changing gradle version in gradle/wrapper/gradle-wrapper.properties
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-all.zip
to something like
distributionUrl=http\://services.gradle.org/distributions/gradle-2.2.1-all.zip