Add Google Maven Repository To Android Studio Project

Posted on

With latest Android Studio, I alter the targetSdkVersion and compileSdkVersion of my onetime do to 28. And I also bring to role updated com.android.support:appcompat-v7 and com.android.support.constraint:constraint-layout. After neglect inwards rebuild, it’s a position out of WARNING together with ERROR.

—————————–
ERROR: Failed to resolve: com.android.support:appcompat-v7:28.0.0
Add Google Maven repository together with sync project
Show inwards Project Structure dialog
Affected Modules: app

ERROR: Failed to resolve: com.android.support.constraint:constraint-layout:1.1.3
Add Google Maven repository together with sync project
Show inwards Project Structure dialog
Affected Modules: app

WARNING: Configuration ‘compile’ is obsolete together with has been replaced amongst ‘implementation’ together with ‘api’.
It volition live on removed at the terminate of 2018. For to a greater extent than information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

WARNING: Configuration ‘testCompile’ is obsolete together with has been replaced amongst ‘testImplementation’.
It volition live on removed at the terminate of 2018. For to a greater extent than information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app

WARNING: Configuration ‘androidTestCompile’ is obsolete together with has been replaced amongst ‘androidTestImplementation’.
It volition live on removed at the terminate of 2018. For to a greater extent than information see: http://d.android.com/r/tools/update-dependency-configurations.html
Affected Modules: app
—————————–

As suggested, I change  ‘compile’, ‘testCompile’ and ‘androidTestCompile’ to ‘implementation’, ‘testImplementation’ and ‘androidTestImplementation’, inwards app/build.gradle.

To attain the fault of Failed to resolve: com.android.support:appcompat-v7:28.0.0 and com.android.support.constraint:constraint-layout:1.1.3, I add together the follow lines of Google Maven repository to build.gradle.

        maven {             url 'https://maven.google.com/'             mention 'Google'         } 

And rebuild the project. At to the lowest degree it industrial plant for me now.


So, how to know the latest version of com.android.support:appcompat-v7 together with com.android.support.constraint:constraint-layout?

For Support Library, y’all tin cheque here: Android Developers > Platform > Libraries > Recent Support Library Revisions

28.0.0 is the recentest stable unloosen of Support Library released on September 21, 2018 together with volition live on the concluding characteristic unloosen nether the android.support packaging.

For ConstraintLayout, Google announced at  .

You tin also cheque from Maven repository:
>> com.android.support >> appcompat-v7
>> com.android.support.constraint >> constraint-layout