Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

when I try to "sync project with gradle files" a warning pops up

Warning: Mapping new ns schemas.android.com/repository/android/common/02 to old ns schemas.android.com/repository/android/common/01
Warning: Mapping new ns schemas.android.com/repository/android/generic/02 to old ns schemas.android.com/repository/android/generic/01
Warning: Mapping new ns schemas.android.com/sdk/android/repo/addon2/02 to old ns schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns /schemas.android.com/sdk/android/repo/repository2/02 to old ns schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns schemas.android.com/sdk/android/repo/sys-img2/02 to old ns schemas.android.com/sdk/android/repo/sys-img2/01
like image 733
Qbert Avatar asked Apr 07 '21 18:04

Qbert


People also ask

How do I sync a project with Gradle files?

Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.

Why does Gradle Sync Fail?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.


2 Answers

this changes work for me with last gradle version 7.3.3

just edit this versions and build your app

android/build.gradle

buildscript {
   repositories {
       ...
   }

   dependencies {
      classpath 'com.android.tools.build:gradle:7.0.0'
      ...
   }
}

android/gradle/wrapper/gradle-wrapper.properties

...
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
like image 122
tahamv Avatar answered Oct 10 '22 09:10

tahamv


What works for me is the same as https://stackoverflow.com/a/70035679/17825313

But I could not find that menu in my AndroidStudio so have to update the content of these 2 files directly:

Basically just use the latest gradle plugin and gradle version and make sure they both match according to the official doc

android/build.gradle

buildscript {
   repositories {
       ...
   }

   dependencies {
      classpath 'com.android.tools.build:gradle:7.0.0'
      ...
   }
}

android/gradle/wrapper/gradle-wrapper.properties

... 
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
like image 14
Pin Avatar answered Oct 10 '22 10:10

Pin