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

Problem with cordova build with cordova-diagnostic-plugin@3.6.5 #216

Closed
pom421 opened this issue Jun 14, 2017 · 1 comment
Closed

Problem with cordova build with cordova-diagnostic-plugin@3.6.5 #216

pom421 opened this issue Jun 14, 2017 · 1 comment

Comments

@pom421
Copy link

pom421 commented Jun 14, 2017

There is a regression with the version 3.6.5.

$ cordova -v
7.0.1
$ cordova platform list
{}
Installed platforms:
android 6.2.3
$ cordova plugin add cordova.plugins.diagnostic@3.6.5
$ cordova build android

:mergeDebugResources
:processDebugManifest/Users/toto/workspace/app/SMARTPHONE_CLI_CORDOVA/app/platforms/android/AndroidManifest.xml:27:9-31 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.


See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

:processDebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : 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.

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

BUILD FAILED

Total time: 22.836 secs
Error: /Users/toto/workspace/app/SMARTPHONE_CLI_CORDOVA/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/toto/workspace/app/SMARTPHONE_CLI_CORDOVA/app/platforms/android/AndroidManifest.xml:27:9-31 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.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugManifest'.
> Manifest merger failed : 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.

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

When I return to 3.6.4, this is OK.

@dpa99c
Copy link
Owner

dpa99c commented Jun 14, 2017

v3.6.5 pins the Gradle versions for Android Support Libraries to v25 prevent v26 alpha versions leaking in and causing build errors (see here).

However if another plugin in your project uses unpinned Gradle versions, then that will cause the above error. See #212 for explanation and suggested steps to resolve.

Note this has caused issues with other plugins too, for example cordova-plugin-facebook4 and phonegap-plugin-barcodescanner

Using v3.6.4 works in your case because the other plugin(s) are also pulling in v26 alpha.
However, this isn't a generic solution: if you were using cordova-plugin-facebook4 your build would fail because of the above mentioned issues.

Closing as this is not an issue with with v3.6.5, but a knock-on effect of the alpha versions of Android Support Libraries permeating the Gradle versioning system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants