getting this error when trying to Build my empty libgdx android studio project ..
Could not find com.android.tools.build:aapt2:3.2.0-alpha16-4748712.
Searched in the following locations:
file:/C:/Users/Noor~.~/android-sdks/extras/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
file:/C:/Users/Noor~.~/android-sdks/extras/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
file:/C:/Users/Noor~.~/android-sdks/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
file:/C:/Users/Noor~.~/android-sdks/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
file:/C:/Users/Noor~.~/android-sdks/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
file:/C:/Users/Noor~.~/android-sdks/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
file:/C:/Users/Noor~.~/.m2/repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
file:/C:/Users/Noor~.~/.m2/repository/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
https://repo.maven.apache.org/maven2/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
https://repo.maven.apache.org/maven2/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
https://oss.sonatype.org/content/repositories/releases/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712.pom
https://oss.sonatype.org/content/repositories/releases/com/android/tools/build/aapt2/3.2.0-alpha16-4748712/aapt2-3.2.0-alpha16-4748712-windows.jar
Required by:
project :android
You're missing the repositories dependency on Google Maven. You need to edit your main build.gradle file to contain:
buildscript {
repositories {
google() //This!
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha16'
}
}
allprojects {
repositories {
google() // And this!
jcenter()
}
}
So apparently changing the Gradle version fixed the problem for me. The Gradle version that is working is 3.1.3 but I'm not sure why that worked or if it will work for everyone.
Related
I want to install gradle 5.5.1 (from local) on Android Studio 3.4.2, for this download grandle gradle-5.5.1-all.zip and on the "gradle-wrapper.properties" file change this:
distributionUrl=file:///E:/Downloads/gradle-5.5.1-all.zip
and on "build.gradle":
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:5.5.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
but when want to make the project I have get this error:
ERROR: Could not find com.android.tools.build:gradle:5.5.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.5.1/gradle-5.5.1.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/5.5.1/gradle-5.5.1.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.5.1/gradle-5.5.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/5.5.1/gradle-5.5.1.jar
Required by:
project :
Open File
But there is no file at these URLs, whats wrong?
just replace this wrongful line:
classpath 'com.android.tools.build:gradle:5.5.1'
with a version of build-tools, which actually exists:
classpath 'com.android.tools.build:gradle:3.4.2'
I got this error when I used this dependency 'com.myhexaville:smart-image-picker:1.0.3'
When i commented this dependency, gradle synced successfully.
Please suggest me a proper solution for this problem.
Add Google's Maven repository to your project's build.gradle file :
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
If you are using android-studio 3.0 or above use this :
allprojects {
repositories {
jcenter()
google()
}
}
This has given me issues since i installed AS it has been having different issues and this is the latest that comes on when I try to build gradle, i have cleaned, updated SDK , restarted but till now no solution, please help.
I also faced this issue before , so i try Clean project then Rebuild project after that i try invalidate caches & Restart and the problem solved.
I solved my problem by removing
maven {
url "https://maven.google.com"
}
in the allprojects { repositeries{ ... } } lines below the buildscript { ... } lines.
Then, I add google() before jcenter() like that :
allprojects {
repositories {
google()
jcenter()
}
...
}
Gradle is unable to resolve the com.android.support:design-v7:27.1.1 dependency, and I get the following error in Android Studio:
Failed to resolve: com.android.support:design-v7:27.1.1
enter image description here
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
There is no such artifact as com.android.support:design-v7:27.1.1. Gradle couldn't download (resolve) this dependency since it's not valid and not present in the maven repository.
Instead try this com.android.support:design:27.1.1, since this is the actual artifact.
Change this in your build.gradle and sync again. This should fix the issue.
EDIT:
The compile is obsolete and use implementation is not the issue here. But please use implementation instead of compile.
Try this:
The solution is to upgrade classpath com.google.gms:google-services to classpath 'com.google.gms:google-services:3.2.1' in file in build.gradle Project:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
it works
I am trying to Set up a Navigation Drawer by Neokree https://github.com/neokree/MaterialNavigationDrawer on Android Studio with no success.
After adding this to my gradle -> build.gradle file
repositories {
mavenCentral()
}
dependencies {
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
}
And then i get this Error Saying "Gradle project Sync Failed" and this below
Error:(27, 0) Gradle DSL method not found: 'compile()'
Possible causes: The project 'MaterialNavigationDrawer' may be using a version of Gradle that does not contain the method.
Gradle settings The build file may be missing a Gradle plugin.
Apply Gradle plugin.
This is my gradle folder -> Build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
repositories {
mavenCentral()
}
dependencies {
compile 'it.neokree:MaterialNavigationDrawer:1.3.3'
}
I know am doing something wrong for sure, and I can't seem to figure it out.
There is a great library called MaterialDrawer. You can integrate this library in less than 5 minutes in your project (read its README.md and Wiki - a lot of informations is available there!).
Good luck!