Android Builds Failing - OneSignal 3.0.1

I had to remove this from my config.xml to get a successful build: <engine name="android" spec="10.1.1" />

I was targeting android sdk 30.

Nothing changed from a few days ago when the builds were successful except some code in my “www”. Plugins, config.xml, etc all unchanged.

Error from the build:

`FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> A failure occurred while executing
   > The minCompileSdk (31) specified in a
     dependency's AAR metadata (META-INF/com/android/build/gradle/
     is greater than this module's compileSdkVersion (android-30).
     AAR metadata file: /Users/agent04/.gradle/caches/transforms-3/73e09204760ea4755dc4d86cf2bf4d4f/transformed/work-runtime-2.7.1/META-INF/com/android/build/gradle/`

The problem seems to be this plugin: onesignal-cordova-plugin.

Since you don’t specify which version you want, it grabs the latest version. It was updated just a couple of days ago, which would account for your app suddenly stopping working.

You might want to dig into that a bit and perhaps specify an older version of the plugin. The maintainer may also be able to shed a light on what is going on.

This might work:

<plugin name="onesignal-cordova-plugin" spec="3.0.0"/>

Thanks! I’ll try that with the next upload.

I upgraded onesignal to 3.0.1 locally and ran into the same issue as well. Thanks again for figuring out the root cause. I will keep it at 3.0.0 for the time being as this appears to be their problem.

The solution seems to be indicated here. Is this something Voltbuilder needs to do or is there some flag we can define for it?

I don’t know of a way to get Cordova to pass parameters to Gradle - if there was a way, it would be in config.xml.

I see you’ve opened an issue at OneSignal. Let’s see what happens.

Looks like they fixed it :slight_smile:

Nice that they fixed it quickly!