Support Android Repo 46.0.0 with Android Studio 2.3

I upgraded my support repository today to 46.0.0 when the Android Studio notification popped up.

The following is the error:

Error: execution completed for task ': app: processDevDebugManifest'.

Manifest merge failed: attribute meta-data#android.support.VERSION@value value = (25.3.0) from [com.android.support:support-v13:25.3.0] AndroidManifest.xml: 27: 9-31 also present on [com.android.support:preference-v7:26.0.0-alpha1] AndroidManifest.xml: 24: 9-38 value = (26.0.0-alpha1). Suggestion: add 'tools: replace = "android: value" "for the item in AndroidManifest.xml: 25: 5-27: 34 to override.

I updated all my dependencies to use Revision 26.0.0 Alpha 1 from 25.3.0, but it turns out I need to raise compileSdk from 25 to 26. You cannot do this if you have AS 2.3, you need to get unstable alpha / beta from the canary.

This link shows the changes: https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0-alpha1

And as for the transition to the new Android-O, then the link: https://developer.android.com/preview/migration.html

It seems that using a stable version of AS will not work with the new repository.

How can I return to the Android Studio repository version 45 instead of the new 46?

** Update: the combined manifest shows that one of the generated library manifest contains

<meta-data android:name="android.support.VERSION" android:value="26.0.0-alpha1" /> 

But since this generated file editing is useless, that’s why I now stick with rev 45 until the new AS is in a stable structure

+45
android android-studio android-support-library
Mar 22 '17 at 11:11
source share
6 answers

What a problem

Some libraries depend on version β€œX” or β€œNewer” on Android support libraries, so Gradle dependency resolution captures everything that is newest available, ignoring that you really have the exact version specified in your dependencies block.

This is not what you want. You want all support libraries with the same version and major version to match the compilation of the SDK version.

What solution

Fortunately, you can force the installation of a specific version of the support library.

Put this at the end of your build.gradle application build.gradle :

 configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.0' } } } } 

Of course, replace the version with what you are using.

Version values ​​for support libraries in the dependecies block dependecies now irrelevant.

If in doubt

This is a well documented method and it works.

What can you do to help

Find libraries that depend on the range of support library versions

 gradlew dependencies --configuration compile -p <module name> | grep , 

and let the authors of these libraries know that they should be transitively dependent on the oldest support libraries that their library can work with.

The goal is to avoid the problem at all.

+131
Mar 22 '17 at 16:14
source share
β€” -

This is the solution to fix:

  • Go to the project explorer view
  • Reach their external libraries
  • See which library uses 26.0.0-alpha6
  • Now write this in the library-based app.gradle in step 3

Ex. in my case:

 configurations.all { resolutionStrategy.force 'com.android.support:appcompat-v7:25.3.0' resolutionStrategy.force 'com.android.support:support-v13:25.3.0' } 

This will force the project to use the specified library.

+2
Mar 23 '17 at 18:16
source share

I think the best solution is to simply return the Android support library to version 45.

To do this, open this link (change the version to what suits you)

https://dl-ssl.google.com/android/repository/android_m2repository_r45.zip

When downloading, unzip and copy m2repository to android-sdk-root-folder \ extras \ android. Be sure to remove the existing m2repository before unpacking to avoid problems.

+1
Mar 30 '17 at 7:04 on
source share

Step 1

To avoid Gradle checking for incompatible versions of com.android.support , a quick fix is ​​to add the following code to the build.gradle application build.gradle .

 dependencies { //noinspection GradleCompatible } 

This is a temporary solution that does not solve the main problems! This helped to continue the development of your application with minimal changes.

Step 2

Add this to the main manifest file AndroidManifest.xml .

 <meta-data tools:replace="android:value" android:name="android.support.VERSION" android:value="25.3.1" /> 

This entry will be deleted if one of the following support repository updates is available.

Step 3

Add the following code to the end of the build.gradle application module file:

 configurations.all { resolutionStrategy.eachDependency { details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.1' } } } } 

NB . It is recommended that your Gradle libraries be updated and compatible to avoid runtime errors.

+1
Jul 06 '17 at 5:34 on
source share

This is a temporary solution that does not solve the main problems! This helped me to continue software development with minimal changes. Just add this to the main manifest:

 <meta-data tools:replace="android:value" android:name="android.support.VERSION" android:value="25.3.0" /> 

This entry will hopefully be deleted again with one of the following support repository updates.

SOLUTION: The labeled solution worked for me by adding the following 4 of my 10 build.gradle files:

 configurations.all { resolutionStrategy.eachDependency { details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '25.3.0' } } } } 
-one
Mar 22 '17 at 16:22
source share

just make everything: -

compile 'com.android.support:appcompat-v7:25.3.1'

here v7: 25.3.1 is my current version that you just put urs.

in the application gradle file

-one
May 23 '17 at 14:39
source share



All Articles