Android build failed (library being requested by various other libraries)


#1

Hi !

My app was building fine until earlier this month without any change from my side.
I got new error :

What went wrong:
The library com.google.android.gms:play-services-base is being requested by various other libraries at 
[[15.0.1,15.0.1]], but resolves to 16.0.1. Disable the plugin and check your dependencies tree using ./gradlew 
:app:dependencies.
my ./gradlew :app:dependencies (error)
> Configure project :
Configuration 'compile' in project ':' is deprecated. Use 'implementation' instead.
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_3nblz3410hhfaq4k50qv67j1y.run(/home/julien/www/ionic-agenda/platforms/android/build.gradle:149)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)

> Configure project :CordovaLib
publishNonDefault is deprecated and has no effect anymore. All variants are now published.


FAILURE: Build failed with an exception.

* What went wrong:
Project 'app' not found in root project 'android'.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

I’ve seen on stackoverflow issues from native app, who solved the problem by editing gradle. Since on ionic the gradle file is generated by cordova i tried to editing with a hook but no succes so far.

I’ve also tried to add cordova-android-play-services-gradle-release but doesn’t work either.

My Ionic info
Ionic:

    ionic (Ionic CLI)  : 4.2.1 (/home/julien/.nvm/versions/node/v8.11.2/lib/node_modules/ionic)
    Ionic Framework    : ionic-angular 3.9.2
    @ionic/app-scripts : 3.2.0

Cordova:

    cordova (Cordova CLI) : 8.0.0
    Cordova Platforms     : android 6.4.0
    Cordova Plugins       : cordova-plugin-ionic-webview 1.2.1, (and 26 other plugins)

System:

    Android SDK Tools : 26.1.1 (/home/julien/Android/Sdk)
    NodeJS            : v8.11.2 (/home/julien/.nvm/versions/node/v8.11.2/bin/node)
    npm               : 5.6.0
    OS                : Linux 4.15
My cordova plugin
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-admob-sdk 0.18.0 "AdMob SDK"
cordova-open-native-settings 1.5.1 "Native settings"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-admob-free 0.18.0 "Cordova AdMob Plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-appavailability 0.4.2 "AppAvailability"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-device-orientation 1.0.7 "Device Orientation"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-facebook4 2.5.0 "Facebook Connect"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.4.6 "cordova-plugin-googlemaps"
cordova-plugin-googleplus 5.3.2 "Google SignIn"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-is-debug 1.0.0 "IsDebug"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.1 "SocialSharing"
cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill"
cordova-sqlite-storage 2.4.0 "Cordova sqlite storage plugin"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
me.tonny.cordova.plugins.multidex 0.1.0 "Cordova Multi Dex"
uk.co.workingedge.phonegap.plugin.launchnavigator 4.2.2 "Launch Navigator" 

Any suggestion to solve this problem ? Someone else already had this ?
Need more informations ? (Like my gradle, project.properties or something else …)
Thank !


#2

Hi !
No idea ? No one ? Don’t hesitate to ask if you need more details on the issue.

Thank !


#3

Hi !
It is suggested to use + instead of 15.+ to ensure the correct versions are used for cordova-android-play-services-gradle-release or cordova-android-firebase-gradle-release.


#4

Thank’s @georgel2489 for your response but i no longer have this issue. I started a blank new project and then adding the plugins with the exact same configurations(plugins version, config.xml, package.json …), the problem disappeared …


#5

thanks for these tips
dr abidi