OneSignalDevelopers / OneSignal-Cordova-Example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUILD FAILED - Could not determine the dependencies of task ':app:lintVitalRelease'.

sync-by-unito opened this issue · comments

Description:
Hi, my cordova app can not be build with OneSignal plugin. It works with cordova@8.1.0 (Android target: android-28) but it does not work with cordova@9.0.0 (Android target: android-29).

This is concerning because Google does not permit to release apps with target 28.

Environment
OneSignal: 2.11.0
Cordova: 9.0.0
Android target: android-29

Steps to Reproduce Issue:

  1. Add the onesignal-cordova-plugin to your project
  2. Build the project

Console output:

Using cordova-fetch for cordova-android@^9.0.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: xx.xxxxxxxxxx.xxxxxxxxxx
        Name: XXXXXX
        Activity: MainActivity
        Android target: android-29
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@9.0.0
Installing "cordova-plugin-app-version" for android
Installing "cordova-plugin-badge" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-camera" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-file" for 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
Installing "cordova-plugin-inappbrowser" for android
Installing "cordova-plugin-ionic-keyboard" for android
Installing "cordova-plugin-ionic-webview" for android
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-local-notification" for android
Plugin dependency "cordova-plugin-device@2.0.2" already fetched, using that version.
Dependent plugin "cordova-plugin-device" already installed on android.
Plugin dependency "cordova-plugin-badge@0.8.7" already fetched, using that version.
Dependent plugin "cordova-plugin-badge" already installed on android.
Subproject Path: CordovaLib
Subproject Path: app
Installing "cordova-plugin-nativestorage" for android
Installing "cordova-plugin-screen-orientation" for android
Plugin dependency "es6-promise-plugin@4.2.2" already fetched, using that version.
Installing "es6-promise-plugin" for android
Installing "cordova-plugin-splashscreen" for android
Installing "cordova-plugin-transport-security" for 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
Subproject Path: app
Dependent plugin "es6-promise-plugin" already installed on android.
Installing "onesignal-cordova-plugin" for android
Subproject Path: CordovaLib
Subproject Path: app
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\AndroidSDK (DEPRECATED)
Using Android SDK: C:\AndroidSDK
> Task :wrapper

BUILD SUCCESSFUL in 3s
1 actionable task: 1 executed
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 in version 5.0 of the Android Gradle plugin.
For more information, see http://d.android.com/r/tools/update-dependency-configurations.html.
WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
   Please put onesignal-gradle-plugin first OR update to com.android.tools.build:gradle:3.0.0 or newer!
OneSignalPlugin: WARNING: OneSignalPlugin: Downgraded 'com.android.support:28.+' -> 28 to prevent compile errors! Recommend updating your project's compileSdkVersion!

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:support-annotations:28.
     Required by:
         project :app
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app
   > Could not find com.android.support:appcompat-v7:28.
     Required by:
         project :app
   > Could not find com.android.support:cardview-v7:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:support-fragment:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:customtabs:28.
     Required by:
         project :app > com.onesignal:OneSignal:3.15.1
   > Could not find com.android.support:support-v4:28.
     Required by:
         project :app > com.google.android.gms:play-services-basement:16.0.1

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

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

BUILD FAILED in 12s
Command failed with exit code 1: C:\xxxxxx\xxxxxx\platforms\android\gradlew cdvBuildRelease -b C:\xxxxxx\xxxxxx\android\build.gradle

┆Issue is synchronized with this Asana task by Unito

➤ Topiya commented:

@misog I am facing the same problem. Did you find any solution?

➤ misog commented:

> > > @misog I am facing the same problem. Did you find any solution?

The support replied to me:

Thanks for reaching out, our team is aware of this and a fix will be released in the next update, for now, you can add the following to the top of your app/build.gradle
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
to solve the error WARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Let us know if that helps.

I did not try it yet. But I found a workaround:

Add to config.xml and then Google Play will accept the build even if you are using cordova@8.1.0 with target 28

➤ Topiya commented:

@misog Thank you. I will try with your suggestion.