Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.support library version conflicts #212

Closed
frankkoenigstein opened this issue Jun 12, 2017 · 14 comments
Closed

android.support library version conflicts #212

frankkoenigstein opened this issue Jun 12, 2017 · 14 comments
Labels
awaiting response If no response, issue will be closed

Comments

@frankkoenigstein
Copy link

Diagnostic plugin references two libraries:

<framework src="com.android.support:support-v4:25.+" />
<framework src="com.android.support:appcompat-v7:25.+" />

After updating this plugin the android compile exits with the following error:

Error:
Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:25:5-27:34 to override.

Looks like there is a alpha release com.android.support:support-v4:26.0.0-alpha1 which should not be used. Please update your plugin.xml to references an explicite version of android support libraries:

<framework src="com.android.support:support-v4:25.3.1"/>
@dpa99c
Copy link
Owner

dpa99c commented Jun 12, 2017

v4:25.+ means that only v25 versions will be installed; it can't possibly lead to v4:26 components being installed. See the console output below which verifies this by comparing a build with cordova.plugins.diagnostic@3.6.4 (which specifies v4:+) vs a build with cordova.plugins.diagnostic@3.6.5 (which specifies v4:25.+). You can repeat this for yourself using the example project.

You may have another plugin installed in your project which specifies, for example, v4:+. If that's the case, the higher version number will be used, hence ignoring the v4:25.+ now specified by this plugin. You may also have a stale version of the Android platform containing Gradle config with an older version of this plugin - best thing is to start with a fresh platform: cordova platform rm android && cordova platform add android.

console output for build using `cordova.plugins.diagnostic@3.6.4`

$ cordova plugin add cordova.plugins.diagnostic@3.6.4
Adding cordova.plugins.diagnostic to package.json
Saved plugin info for "cordova.plugins.diagnostic" to config.xml

$ more plugins/cordova.plugins.diagnostic/plugin.xml | grep com.android
        <framework src="com.android.support:support-v4:+" />
        <framework src="com.android.support:appcompat-v7:+" />

$ cordova platform add android@latest
Using cordova-fetch for cordova-android@latest
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: cordova.plugins.diagnostic.example
        Name: Diagnostic_plugin_example
        Activity: MainActivity
        Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.2.3
Installing "cordova-custom-config" for android
Installing "cordova-plugin-camera" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Installing "cordova-plugin-compat" for android
Dependent plugin "cordova-plugin-compat" already installed on android.
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-file" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its
config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

Installing "cordova-plugin-geolocation" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "cordova.plugins.diagnostic" for android
Subproject Path: CordovaLib
cordova-custom-config: Skipping auto-restore of config file backup(s)
cordova-custom-config: Applied custom config from config.xml to D:\Git\cordova-diagnostic-plugin-example\platforms\android\AndroidManifest.xml
--save flag or autosave detected
Saving android@latest into config.xml file ...

$ cordova build android
cordova-custom-config: Skipping auto-restore of config file backup(s)
cordova-custom-config: Applied custom config from config.xml to D:\Git\cordova-diagnostic-plugin-example\platforms\android\AndroidManifest.xml
ANDROID_HOME=G:\Users\dpa99_000\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
Parallel execution with configuration on demand is an incubating feature.
:wrapper

BUILD SUCCESSFUL

Total time: 1.062 secs
Subproject Path: CordovaLib
Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_6na8x8z22cx5xf5vxvmdmnbdv.run(D:\Git\cordova-diagnostic-plugin-example\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to
be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty()
instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:generateDebugBuildConfig
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:generateDebugResValues
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:compileLint
:incrementalDebugJavaCompilationSafeguard
:CordovaLib:copyDebugLint NO-SOURCE
:CordovaLib:mergeDebugShaders
:compileDebugNdk NO-SOURCE
:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:compileDebugShaders
:generateDebugAssets
:CordovaLib:mergeDebugProguardFiles
:processDebugJavaRes NO-SOURCE
:validateSigningDebug
:CordovaLib:packageDebugRenderscript NO-SOURCE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:CordovaLib:compileReleaseNdk NO-SOURCE
:CordovaLib:copyReleaseLint NO-SOURCE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processReleaseJavaRes NO-SOURCE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportAnimatedVectorDrawable2600Alpha1Library
:prepareComAndroidSupportAppcompatV72600Alpha1Library
:prepareComAndroidSupportSupportCompat2600Alpha1Library
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library
:prepareComAndroidSupportSupportFragment2600Alpha1Library
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library
:prepareComAndroidSupportSupportV42600Alpha1Library
:prepareComAndroidSupportSupportVectorDrawable2600Alpha1Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileDebugSources
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:transformNative_libsWithStripDebugSymbolForDebug
:transformResourcesWithMergeJavaResForDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 28.838 secs
Built the following apk(s):
        D:/Git/cordova-diagnostic-plugin-example/platforms/android/build/outputs/apk/android-debug.apk


:prepareComAndroidSupportAppcompatV72600Alpha1Library

i.e. v7:26.0.0-alpha1

console output for build using `cordova.plugins.diagnostic@3.6.5`

cordova plugin add cordova.plugins.diagnostic@3.6.5
Adding cordova.plugins.diagnostic to package.json
Saved plugin info for "cordova.plugins.diagnostic" to config.xml

$ more plugins/cordova.plugins.diagnostic/plugin.xml | grep com.android
        <framework src="com.android.support:support-v4:25.+" />
        <framework src="com.android.support:appcompat-v7:25.+" />

$ cordova platform add android@latest
Using cordova-fetch for cordova-android@latest
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: cordova.plugins.diagnostic.example
        Name: Diagnostic_plugin_example
        Activity: MainActivity
        Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.2.3
Installing "cordova-custom-config" for android
Installing "cordova-plugin-camera" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Installing "cordova-plugin-compat" for android
Dependent plugin "cordova-plugin-compat" already installed on android.
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-file" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its
config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

Installing "cordova-plugin-geolocation" for android
Plugin dependency "cordova-plugin-compat@1.1.0" already fetched, using that version.
Dependent plugin "cordova-plugin-compat" already installed on android.
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Installing "cordova.plugins.diagnostic" for android
Subproject Path: CordovaLib
cordova-custom-config: Skipping auto-restore of config file backup(s)
cordova-custom-config: Applied custom config from config.xml to D:\Git\cordova-diagnostic-plugin-example\platforms\android\AndroidManifest.xml
--save flag or autosave detected
Saving android@latest into config.xml file ...


$ cordova build android
cordova-custom-config: Skipping auto-restore of config file backup(s)
cordova-custom-config: Applied custom config from config.xml to D:\Git\cordova-diagnostic-plugin-example\platforms\android\AndroidManifest.xml
ANDROID_HOME=G:\Users\dpa99_000\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Parallel execution with configuration on demand is an incubating feature.
:wrapper

BUILD SUCCESSFUL

Total time: 6.073 secs
Subproject Path: CordovaLib
Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_6na8x8z22cx5xf5vxvmdmnbdv.run(D:\Git\cordova-diagnostic-plugin-example\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to
be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty()
instead.
:preBuild UP-TO-DATE
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugAidl
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:generateDebugBuildConfig
:generateDebugResValues
:CordovaLib:compileDebugNdk NO-SOURCE
:CordovaLib:compileLint
:incrementalDebugJavaCompilationSafeguard
:CordovaLib:copyDebugLint NO-SOURCE
:CordovaLib:mergeDebugShaders
:compileDebugNdk NO-SOURCE
:mergeDebugShaders
:CordovaLib:compileDebugShaders
:compileDebugShaders
:generateDebugAssets
:processDebugJavaRes
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:processDebugJavaRes NO-SOURCE
:validateSigningDebug
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript NO-SOURCE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes NO-SOURCE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:checkReleaseManifest
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseNdk NO-SOURCE
:CordovaLib:copyReleaseLint NO-SOURCE
:CordovaLib:mergeReleaseShaders
:CordovaLib:compileReleaseShaders
:CordovaLib:generateReleaseAssets
:CordovaLib:mergeReleaseAssets
:CordovaLib:mergeReleaseProguardFiles
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:CordovaLib:compileReleaseRenderscript
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:processReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:processReleaseResources
:CordovaLib:generateReleaseSources
:CordovaLib:incrementalReleaseJavaCompilationSafeguard
:CordovaLib:compileReleaseJavaWithJavac
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
:CordovaLib:processReleaseJavaRes NO-SOURCE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForReleaseNote: Recompile with -Xlint:deprecation for details.

:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportAnimatedVectorDrawable2531Library
:prepareComAndroidSupportAppcompatV72531Library
:prepareComAndroidSupportSupportCompat2531Library
:prepareComAndroidSupportSupportCoreUi2531Library
:prepareComAndroidSupportSupportCoreUtils2531Library
:prepareComAndroidSupportSupportFragment2531Library
:prepareComAndroidSupportSupportMediaCompat2531Library
:prepareComAndroidSupportSupportV42531Library
:prepareComAndroidSupportSupportVectorDrawable2531Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:compileDebugSources
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:transformNative_libsWithStripDebugSymbolForDebug
:transformResourcesWithMergeJavaResForDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 37.497 secs
Built the following apk(s):
        D:/Git/cordova-diagnostic-plugin-example/platforms/android/build/outputs/apk/android-debug.apk


:prepareComAndroidSupportAppcompatV72531Library

i.e. v7:25.3.1

@klochko7
Copy link

dpa99c , good day ! Could you suggest please how to fix this ? I am not professional android developer, I am using Ionic3.

@dpa99c
Copy link
Owner

dpa99c commented Jun 14, 2017

@klochko7 The most likely cause is a Gradle version conflict with another plugin in your project.

You need to go through each plugin.xml in plugins/ and find any that have <framework src="com.android.support:support-v4:+" /> or <framework src="com.android.support:appcompat-v7:+" /> and change to <framework src="com.android.support:support-v4:25.+" /> and <framework src="com.android.support:appcompat-v7:25.+" /> respectively. Then remove and re-add Android platform to rebuild Gradle config: cordova platform rm android && cordova platform add android.

See #203 and #205 for more details.

@frankkoenigstein
Copy link
Author

The problem is with https://github.com/phonegap/phonegap-plugin-barcodescanner/blob/master/src/android/barcodescanner.gradle#L15

It works find with cordova 7.0.1 but not with cordova 6.5.0

@dpa99c
Copy link
Owner

dpa99c commented Jun 14, 2017

@frankkoenigstein Seems there's an issue opened against that plugin which covers it: phonegap/phonegap-plugin-barcodescanner#480.

But I will close the issue because this plugin can do nothing about the Gradle versioning in other plugins.

@klochko7
Copy link

In my progect I found only one place with it in de.appplant.cordova.plugin.local-notification ...

<framework src="com.android.support:support-v4:+" value="gradle" />

I change to

<framework src="com.android.support:support-v4:25.+" value="gradle" />

But now I see ..

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

Could not resolve all dependencies for configuration ':_armv7DebugApkCopy'.
Could not find any matches for src=com.android.support:support-v4:25.+ as n
o versions of src=com.android.support:support-v4 are available.
Required by:

BUILD FAILED

Total time: 25.35 secs

     :android:unspecified
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

Could not resolve all dependencies for configuration ':_armv7DebugApkCopy'.
Could not find any matches for src=com.android.support:support-v4:25.+ as n
o versions of src=com.android.support:support-v4 are available.
Required by:
:android:unspecified

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

@klochko7
Copy link

I did ..

ionic platform rm android
ionic platform add android@latest

and unfortunately see ...

:processArmv7DebugManifest FAILED

BUILD FAILED

Total time: 14.779 secs

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':processArmv7DebugManifest'.

Manifest merger failed : Attribute meta-data#android.support.VERSION@value val
ue=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:2
7:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] Androi
dManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element a
t AndroidManifest.xml:25:5-27:34 to override.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

Error: cmd: Command failed with exit code 1 Error output:
D:\tmp\ionic2\ezpart-mobile-svn\platforms\android\AndroidManifest.xml:27:9-31 Er
ror:
Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [c
om.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] Androi
dManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element a
t AndroidManifest.xml:25:5-27:34 to override.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':processArmv7DebugManifest'.

Manifest merger failed : Attribute meta-data#android.support.VERSION@value val
ue=(25.3.1) from [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:2
7:9-31
is also present at [com.android.support:support-v4:26.0.0-alpha1] Androi
dManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to element a
t AndroidManifest.xml:25:5-27:34 to override.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug
    option to get more log output.

@dpa99c
Copy link
Owner

dpa99c commented Jun 14, 2017

@klochko7 that error implies something (a plugin) is still pulling in com.android.support:support-v4:+. Check that your local changes to plugin.xml files haven't been overwritten.

@klochko7
Copy link

klochko7 commented Jun 14, 2017

dpa99c, BUILD SUCCESSFUL, but I need unfortunately to delete .. сordova-plugin-crosswalk-webview ... this plugin helps my app run well on Android < 5 .. Could I fix this ?

@dpa99c
Copy link
Owner

dpa99c commented Jun 14, 2017

@klochko7 From what I can see, the crosswalk plugin itself doesn't specify any versions of these libraries, so it's likely that they are being specified by the crosswalk engine itself which is itself being pulled in by Gradle via the plugin.

To that, there's not much of an easy solution. You can try going through the .gradle files in platforms/android once crosswalk is installed and find where the v4:+/v7:+ is being set and change it in place. Or you can try setting this plugin's plugin.xml back to v4:+/v7:+ and see if the build works with v26-alpha.

As @fredgalvao rightly said, the fault really lies with Gradle/Android for allowing alpha versions to leak out without them being specifically requested.

@klochko7
Copy link

dpa99c, ok I will try ..

@Azadrum
Copy link

Azadrum commented Oct 6, 2017

Who ever put this note into plugin readme.md.... I love you

If your build fails with an error such as this:

Attribute meta-data#android.support.VERSION@value value=(26.0.0-alpha1) from [com.android.support:support-v4:26.0.0-alpha1] AndroidManifest.xml:27:9-38
is also present at [com.android.support:appcompat-v7:25.3.1] AndroidManifest.xml:27:9-31 value=(25.3.1).

Then it's likely that the build failure is due to a collision caused by another plugin requesting a different version of the Android Support Library (see #212, #211, #205, etc.).

@yaminijain
Copy link

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.2'
}
}
}
}
NOTE :Add this to your build.gradle and make sure you are using the same versions as '26.0.2'.

@dpa99c
Copy link
Owner

dpa99c commented Oct 4, 2018

@yaminijain cordova-android-support-gradle-release does exactly this in order to override the versions specified by other plugins (e.g. this one) in order to resolve conflicts:

$ cordova plugin add cordova-android-support-gradle-release  --variable ANDROID_SUPPORT_VERSION=26.0.2

This allows the problem to be solved without need for manual modification of the build.gradle file which is volatile in Cordova-based app projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response If no response, issue will be closed
Projects
None yet
Development

No branches or pull requests

5 participants