Closed misog closed 3 years ago
@misog I am facing the same problem. Did you find any solution?
@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 <preference name="android-targetSdkVersion" value="29" />
to config.xml and then Google Play will accept the build even if you are using cordova@8.1.0 with target 28
@misog Thank you. I will try with your suggestion.
I'm getting the same issue
Howdy,
You can add the following to the top of your
app/build.gradle
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
to solve the errorWARNING: The onesignal-gradle-plugin MUST be before com.android.application!
Did folks try this? Please let us know if this worked for you.
If not, can anyone report back on the workaround proposed by misog @Topiya?
Thank you
I have not tried to submit an app using cordova@8.1.0 since Google is asking for target 29.
You can try to force android cordova version and stick with 8.1.0 (cordova platform add android@8.1.0) on android-targetSdkVersion=29: everything builds just fine and deployment on google console will be successful.
The only downside is that you should be really careful with plugins like cordova-plugin-camera: the new version 5.0.0 is no more compatible with cordova-android below 9.0.0.
In short words: the "workaround" here is fine, but I'm really looking forward an update, newer is (almost) ever better!
@dariocarbone Thank you for the reply.
I tried to put <preference name="android-targetSdkVersion" value="29" />
to config.xml. But it is not generating defaultTargetSdkVersion as 29 in build.gradle
with cordova@8.1.0
project.ext {
defaultBuildToolsVersion="28.0.3" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
}
Can you please let me know how to force android cordova version and stick with 8.1.0 ?
you can launch from terminal: cordova platform remove android (then) cordova platform add android@8.1.0
So you are telling to reinstall cordova-android@8.1.0 ? because currently I am doing build with cordova-android@8.1.0 only and it is showing defaultTargetSdkVersion=28
in build.gradle.
remove and adding cordova-android@8.1.0 again will generate defaultTargetSdkVersion=29
?
when i look into build.gradle the defaultTargetSdkVersion=28 but after deploying on google console the sdk target is 29...
@misog @dariocarbone Thank you for providing this solution. It worked for me.
Closing this issue to merge with #657
anyone have this solution?
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'. Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-manifest, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-api}. Execution failed for JetifyTransform: C:\Users\Home.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native\0.71.0-rc.0\7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543\react-native-0.71.0-rc.0-debug.aar. Java heap space
I found this issue running gradlew assemble.
I want to know the way how to solve
@CodingWarm any luck?
Hi @CodingWarm, Your error mentions react native and this is the OneSignal Cordova SDK. I also don't see any reference to OneSignal in your error.
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:
Console output: