dpa99c/cordova-android-support-gradle-release

Warning on build about 'compile' is obsolete

BorntraegerMarc opened this issue · 4 comments

I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Bug report

Current behavior:
When building my app with this plugin I receive the following warning in the console:

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Which leads to when opening the app with Android studio that I get an build error and I need to manually click in Android studio "refactor to not use compile".

Would be nice if this plugin doesn't use compile anymore.

According to http://d.android.com/r/tools/update-dependency-configurations.html this is the best practice.

Expected behavior:
No exception.

Steps to reproduce:
Add this plugin as dependency to starter kit cordova app.

Environment information

  • Cordova CLI version
    • 8.0.0
  • Cordova platform version
Installed platforms:
  android 8.0.0
Available platforms: 
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~5.0.0
  www ^3.12.0
  • Plugins & versions installed in project (including this plugin)
cordova-android-support-gradle-release 2.0.1 "cordova-android-support-gradle-release"
cordova-clipboard 1.2.1 "Clipboard"
cordova-plugin-add-swift-support 1.7.1 "AddSwiftSupport"
cordova-plugin-advanced-http 2.0.1 "Advanced HTTP plugin"
cordova-plugin-aes256-encryption 1.2.0 "AES256"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-cocoapod-support 1.6.0 "Cordova CocoaPods Dependency Support"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-opener2 2.0.19 "File Opener2"
cordova-plugin-filechooser 1.0.1 "File Chooser"
cordova-plugin-filepath 1.4.2 "cordova-plugin-filepath"
cordova-plugin-filepicker 1.1.5 "File Picker"
cordova-plugin-ionic-webview 2.3.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.3 "LocalNotification"
cordova-plugin-media-capture 3.0.2 "Capture"
cordova-plugin-nativestorage 2.3.2 "NativeStorage"
cordova-plugin-safariviewcontroller 1.5.4 "SafariViewController"
cordova-plugin-secure-storage 3.0.1 "SecureStorage"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-support-google-services 1.3.1 "cordova-support-google-services"
ionic-plugin-deeplinks 1.0.17 "Ionic Deeplink Plugin"
komed-cordova-plugin-ionic-keyboard 2.1.2 "komed-cordova-plugin-ionic-keyboard"
komed-cordova-plugin-twiliovoice 2.5.0 "TwilioVoice"
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.2.3 "PushPlugin"
  • Dev machine OS and version, e.g.
    • OSX
      • 10.14.3

Runtime issue

  • Device details
    • e.g. iPhone 7, Samsung Galaxy S8, iPhone X Simulator, Pixel XL Emulator
  • OS details
    • e.g. iOS 11.2, Android 8.1

Android build issue:

  • Node JS version
    • v8.13.0
  • Gradle version
    • 4.10.1 5.2.1 buildOutputCleanup vcs-1
  • Target Android SDK version
    • 21

If using an Ionic Native Typescript wrapper for this plugin:

  • Ionic environment info

Ionic:

   ionic (Ionic CLI)  : 4.11.0 (/Users/borntsch/.nvm/versions/node/v8.13.0/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

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

System:

   Android SDK Tools : 26.1.1 (/Users/borntsch/Library/Android/sdk)
   ios-deploy        : 1.9.2
   ios-sim           : 7.0.0
   NodeJS            : v8.13.0 (/Users/borntsch/.nvm/versions/node/v8.13.0/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.1 Build version 10B61

Related code:

insert any relevant code here such as plugin API calls / input parameters

Console output

console output
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to /Users/borntsch/Documents/komed/komed-frontend/platforms/android/app/build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to /Users/borntsch/Documents/komed/komed-frontend/platforms/android/cordova-android-support-gradle-release/frontend-cordova-android-support-gradle-release.gradle
Discovered plugin "cordova-support-google-services" in config.xml. Adding it to the project
Plugin "cordova-support-google-services" already installed on android.
Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to /Users/borntsch/Documents/komed/komed-frontend/platforms/android/app/build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to /Users/borntsch/Documents/komed/komed-frontend/platforms/android/cordova-android-support-gradle-release/frontend-cordova-android-support-gradle-release.gradle
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/borntsch/Library/Android/sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript UP-TO-DATE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateDebugSources UP-TO-DATE
> Task :CordovaLib:compileDebugRenderscript UP-TO-DATE
> Task :CordovaLib:generateDebugBuildConfig UP-TO-DATE
> Task :CordovaLib:generateDebugResValues UP-TO-DATE
> Task :CordovaLib:generateDebugResources UP-TO-DATE
> Task :CordovaLib:packageDebugResources UP-TO-DATE
> Task :CordovaLib:generateDebugRFile UP-TO-DATE
> Task :CordovaLib:prepareLintJar UP-TO-DATE
> Task :CordovaLib:generateDebugSources UP-TO-DATE
> Task :CordovaLib:javaPreCompileDebug UP-TO-DATE
> Task :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE

> Task :app:processDebugGoogleServices
Parsing json file: /Users/borntsch/Documents/komed/komed-frontend/platforms/android/app/google-services.json

> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugNdk NO-SOURCE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders UP-TO-DATE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:mergeDebugShaders UP-TO-DATE
> Task :CordovaLib:compileDebugShaders UP-TO-DATE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:signingConfigWriterDebug UP-TO-DATE
> Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
> Task :app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:compileDebugNdk NO-SOURCE
> Task :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
> Task :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
> Task :app:packageDebug
> Task :app:assembleDebug
> Task :app:cdvBuildDebug

BUILD SUCCESSFUL in 4s
43 actionable tasks: 6 executed, 37 up-to-date
Built the following apk(s): 
	/Users/borntsch/Documents/komed/komed-frontend/platforms/android/app/build/outputs/apk/debug/app-debug.apk
✨  Done in 63.30s.



This plugin (as you can see from its Gradle source code) does not generate the compile directives which Gradle is warning about, it simply replaces any existing ones which exist in the project's build.gradle.

Up until cordova-android@7.1.4, Cordova itself generated compile directives. However in cordova-android@8 these have been replaced with implementation. However, many plugins still contain Gradle config files which contain compile, so there's probably at least one in your list of plugins, hence the warning.

This plugin should be updated to match implementation as well as compile directives, so I'll leave this issue open for now with that in mind.

Fix published to npm in v2.1.0

So why am I still getting this warning?? :-/

I also receive this warning, despite using v3.0.1 - the most recent version.