Quantcast
Channel: HTML5
Viewing all articles
Browse latest Browse all 663

FAILURE: Build failed with an exception. -- from CLI 5.1.1 detailed build error log

$
0
0

There are many instances of Android and Crosswalk builds using CLI 5.1.1 that result in an error message similar to the following (see the end parts of the detailed build error log for an example similar to the following):

---- error message found near the end of the detailed build log ----

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.> Could not resolve all dependencies for configuration ':_debugCompile'.> Could not find any version that matches com.google.android.gms:play-services-gcm:+.     Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml

https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/

     Required by:
         :android:unspecified
  > Could not find any version that matches com.android.support:support-v4:+.
     Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml

https://repo1.maven.org/maven2/com/android/support/support-v4/

     Required by:
         :android:unspecified

---- end of error message found near the end of the detailed build log ----

We do not have a solution for this issue, at this time. We are working on finding an adequate short-term and long-term solution. Some of the issues are legal restrictions surrounding the hosting and redistribution of third-party libraries. So this is not just a simple technical issue. This problem only applies to Android and Crosswalk builds and should only be seen when using CLI 5.1.1.

Error messages similar to those shown above, which include a reference to a failed search of "maven," and that typically contain a reference to a com.google.android.*, library are usually being caused by a new version of the plugin due to:

  • a change to using Gradle (from using Ant) for Android (and Crosswalk) Cordova builds
  • plugins being updated to utilize Gradle and Maven as a way to include some third-party libraries
  • some third-party plugins are incompatible with Gradle builds and can only be used with CLI versions <5

The fundamental problem is due to a new way to reference third-party libraries in Android builds with the adoption of the Gradle build system, which was instituted by the Apache Cordova project for Android builds with the change to CLI 5. This change only impacts Android and Crosswalk builds! Workarounds include:

  • using an older version of the plugin that is causing the problem (determining which plugin is the culprit cannot be easily deduced from the error message, so you have to remove plugins one at a time and rebuild your app to figure out which is causing the problem)
  • using the CLI 4.1.2 build option (which uses ANT rather than Gradle to build Android images)
  • using a combination of both of the above workarounds (older plugin and CLI 4.1.2)
  • looking for a branch or fork of the offending plugin that does not rely on this new technique for specifying the inclusion of external third-party libraries (see the technical details section below)

The problem with simply using an older version of the plugin, of course, is that older versions of plugins may still include bugs that are fixed by more recent versions... To tackle this issue, a few plugin developers have created a special branch of the plugin to handle this problem (which tends to be unique to cloud-based build systems). Sometimes you may also find a fork of the plugin that does the same thing. Posting a request with the plugin developer, on their GitHub repo can help to get an appropriate branch created, as a short-term solution.

Identifying usable branches and forks is a time-consuming problem. We are working through the list of featured plugins to identify reasonable alternatives. In some cases we may have to remove a plugin from the featured list if we cannot find a usable alternative, or you may find notes in the description indicating that the plugin is only suitable for a specific CLI build version.

For those who are curious about some of the technical details, please read on...

This problem is caused by a new technique available to CLI 5 Cordova plugin developers, for specifying how to include libraries in Android (and Crosswalk) Cordova builds. An example can be found in the recent version of the PushWoosh plugin. Within the Android <platform> section of the plugin.xml file inside that plugin you will find some lines similar to the following:

<platform name="android">
    ...<framework src="com.google.android.gms:play-services-gcm:+" /><framework src="com.android.support:support-v4:+" />
    ...</platform>

Previous versions of that plugin would have included the libraries directly, usually embedded inside a JAR file, as shown by these statements (which appears to have happened at the transition from version 3.6.4 to version 3.6.5 of this particular plugin):

<platform name="android">
    ....<source-file src="src/android/lib/android-support-v4.jar" target-dir="libs" /><source-file src="src/android/lib/google-play-services.jar" target-dir="libs" />
    ....</platform>

 

 


Viewing all articles
Browse latest Browse all 663

Trending Articles


HOY PANGIT, MAGBAYAD KA!


Henry el monstruo feliz para colorear e imprimir


Dama y vagabundo para pintar


Girasoles para colorear


Good Morning Quotes


RE: Mutton Pies (jameskoiman)


Hagibis (1946) by Francisco V. Coching


Ka riam ka beit bad ka por riam


Vimeo Create - Video Maker & Editor 1.6.0 by Vimeo Inc


Vimeo 3.42.1 by Vimeo Inc



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>