android: Navigation Drawer error in Gradle Build - android

I'm trying to use a Navigation Drawer, but I can't because I get the error:
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find any version that matches com.android.support:design:21.+.
Versions that do not match:
26.0.0-alpha1
25.3.1
25.3.0
25.2.0
25.1.1
+ 21 more
Required by:
project :app
On gradle I have:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:design:21.+'
}
Can you please help me?

Try using this:
compile 'com.android.support:design:21.0.3'
Or:
compile 'com.android.support:appcompat-v7:21.+'
compile 'com.android.support:support-v4:21.+'
compile 'com.android.support:design:21.+'

Related

Failed to resolve com.android.support:support-compat:25.4.0

I am trying to include this library to my project by adding
compile 'jp.wasabeef:recyclerview-animators:2.2.7'
to the dependencies. When the graddle sync happens an error produced like below
Failed to resolve com.android.support:support-recycleriew-v7:25.4.0
Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0
The graddle dependencies looks like
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.5'
compile 'com.android.support:support-core-ui:25.4.0'
compile 'com.android.support:support-compat:25.4.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.7'
}
What is wrong here?
Failed to resolve com.android.support:support-recycleview:25.4.0
There is no library by that name. There is com.android.support:recyclerview-v7:25.4.0.
Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0
These are in the new Google Maven repo. Add maven { url "https://maven.google.com" } to your repositories closure, as shown in the documentation.

why gradle attemps to download appcompat again

Why gradle trys to download dependencies again, when it downloaded them in past?
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.androied.support:appcompat-v7:23.0.1'
//compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile project(':sweetsheet')
compile files('libs/bolts-tasks-1.3.0.jar')
}
the error:
Error:(30, 13) Failed to resolve: com.androied.support:appcompat-v7:23.0.1
Show in File<br>Show in Project Structure dialog
I'm not online all the time. I downloaded the appcompat-v7:
screenshot of downloaded appcompat-v7
You have a typo.
com.androi e d.support:appcompat-v7:23.0.1 instead of
com.android.support:appcompat-v7:23.0.1
You can change gradle settings in the android studio
Go to settings and type gradle then you can tick gradle offline work and the gradle is not going download dependencies every time.

Exoplayer r1.5.2 failed to resolve com.google.android.exoplayer:exoplayer:r1.5.2

I have a problem when trying to compile exoplayer r1.5.2 repository.... There's no issue when I use com.google.android.exoplayer:exoplayer:r1.4.2 instead.
Here's of the compilation code:
And then this error is thrown:
I had this issue as well: I added compile 'com.google.android.exoplayer:exoplayer:r1.5.2' to my app/build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.exoplayer:exoplayer:r1.5.2'
}
And tried sync project in Android Studio, but got the error above.
Solution
I got the dependency downloaded by upgrading to gradle 2.6 and invoking gradle from the shell:
$ ./gradlew build
Upgrading Gradle
Edit the distributionUrl line in <project dir>/gradle/wrapper/gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-all.zip

Error:A occurred configuring project ':app'. Android app

My main project and my dependant project are in the same root directory
like
My root directory : AndroidProjects:
Android-nRF-Toolbox-master
Android-DFU-Library-release
The error reported :
Error:(24) A problem occurred evaluating project ':app'.
Project with path '..:DFULibrary:dfu' could not be found in project ':app'.
My build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile project(':..:DFULibrary:dfu')
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/nrf-logger-v2.0.jar')
}
settings.gradle
include ':app', '..:DFULibrary:dfu'
Please tell me what I am missing here.
Change compile project(':..:DFULibrary:dfu')
to compile project(':DFULibrary:dfu').

Android Sweet Alert Dialog dependencies

I read Sweet AlertDialog tutorial and I have added dependencies to my project this way:
select Build.Gradle (Module:app) and open
go to this line:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
and change to:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'cn.pedant.sweetalert:library:1.3'
}
Run the my app.but i get this error:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:appcompat-v7:21.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar
file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom
file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/android/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar
file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.pom
file:/D:/sdk/ADT-Bundle-Windows-x86-20140702.Full_p30download.com/sdk/extras/google/m2repository/com/android/support/appcompat-v7/21.0.0/appcompat-v7-21.0.0.jar
Required by:
MyApplication:app:unspecified > cn.pedant.sweetalert:library:1.3 > com.pnikosis:materialish-progress:1.0
And when i add appcompat-v7-21.0.0.jar i get this error:
Error:Failed to find: com.android.support:appcompat-v7:21.0.0
Open File<br>Open in Project Structure dialog
Remove appcompat-v7-21.0.0.jar first, then try replace your dependencies with the following:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'cn.pedant.sweetalert:library:1.3'
}
If its a case of missing support library, I think you need to download Android Support Repository from the
Android SDK Manager->SDK Tools->Support Repository->Android Support Repository.

Categories

Resources