This question already has answers here:
android studio 3.0 Canary 1 : project refresh failed
(2 answers)
Closed 5 years ago.
I want to check my projects dependencies but having problem when running
./gradlew app:dependencies
Here is the result of terminal.
Thanks for helps.
I just needed to add new google repo to root gradle file.
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
}
Related
I have upgraded the my exiting project Gradle version from older version to "com.android.tools.build:gradle:7.0.4".
After upgrading the build version some of the existing libraries not working.
I got an error like below:
Failed to resolve: com.yarolegovich:discrete-scrollview:1.5.1 Show in
Project Structure dialog Affected Modules: app
Failed to resolve: com.redmadrobot:input-mask-android:6.0.0 Show in
Project Structure dialog Affected Modules: app
Failed to resolve: gun0912.ted:tedpermission:2.2.3 Show in Project
Structure dialog Affected Modules: app
Failed to resolve: com.theartofdev.edmodo:android-image-cropper:2.8.0
Show in Project Structure dialog Affected Modules: app
Failed to resolve: com.wang.avi:library:2.1.3 Show in Project
Structure dialog Affected Modules: app
We recommend using a newer Android Gradle plugin to use compileSdk =
32
This Android Gradle plugin (7.0.4) was tested up to compileSdk = 31
This warning can be suppressed by adding
android.suppressUnsupportedCompileSdk=32 to this project's gradle.properties
The build will continue, but you are strongly encouraged to update
your project to use a newer Android Gradle Plugin that has been tested
with compileSdk = 32 Affected Modules: app
Please help me to get out this error.
Thanks in advance.
in your build.gradle.app file there must be property called compileSdk which could be 31 or 32. change it to smaller values and try again.
I had the same problem. But I just run the project and it ran without any problems. But the errors still persist.
I think the problem is with Android Studio cache.
However, we have to wait until the next update.
Step 1:
Update the Gradle version & all libraries.
Step 2:
Remove allprojects { } from project-level build.gradle file.
Step 3:
Replace project-level repositories {} with below code
repositories {
maven {
url "PROJECT DEPENDENCY URL" Ex. : https://maven.google.com, https://jitpack.io
}
google()
mavenCentral()
gradlePluginPortal()
}
Step 4:
Same repositories {} code we have to add in settings.gradle file like below:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
url "PROJECT DEPENDENCY URL" Ex. : https://maven.google.com, https://jitpack.io
}
google()
mavenCentral()
gradlePluginPortal()
}
}
Step 5:
Sync Gradle, clean the project & run.
I hope these steps will help you to upgrade the project from the old Gradle version to the new Gradle version 7.0.+.
Add jcenter() in your project level build.gradle like below
allprojects {
repositories {
jcenter()
}}
and
buildscript {
repositories {
jcenter()
}
dependencies {...}}
hope it works, as some of the libraries still in Jcenter()
This question already has answers here:
Gradle DSL method not found: 'implementation()'
(9 answers)
How to fix "ERROR: Gradle DSL method not found" on Android Studio 3.3
(2 answers)
Closed 3 years ago.
I was working on a react native app and I installed react-navigation library and its dependencies. then after I tried to run my app using Android Studio I get this error:
ERROR: Gradle DSL method not found: 'implementation()'
Possible causes:
The project 'MealApp' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin
I changed nothing and this error just poped up. What should I do to get rid of this annoying thing?
the implementation is support in the Gradle version after 3. try to change it in the android/build.gradle as the following
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
At the same time, change the gradle-wrapper.properties Gradle version
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Closed 5 years ago.
After adding lottie to build.gradle file saying Error:Failed to resolve: com.android.support:appcompat-v7:26.1.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Make sure you're including maven repo in your root build.gradle e.g.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Failed to resolve com.google.android.gms play-services-auth:11.4.0
(13 answers)
Failed to resolve: com.google.firebase:firebase-core:11.2.0
(6 answers)
Closed 5 years ago.
I have updated parts of the Android sdk and now I can use newer versions of my libraries but the gradle file doesn't accept them. Can you help me pls?
That one is the only projects where it get an error, that's why I think it gets the error 'cause of a local project file.
I got a failed to resolve error at each library
I use some of Google firebase (11.2.0) ;support:appcompat-v7(26.0.2); support:design (26.0.2)
Android studio says me that are the newest versions for my project.
Play services and Firebase dependencies are now available via maven.google.com with the release of version 11.2.0 of Google Play services and Firebase.
Add maven { url "https://maven.google.com" } to your root level build.gradle file
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For more information please check official doc
This question already has answers here:
Android Studio - local path doesn't exist
(28 answers)
Closed 6 years ago.
When i run application on my connected device, after selecting an device it shows unexpected error,local path doesn't exist.
In build.gradle check if gradle is updated to latest.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
After that clean and rebuild your project.