Reputation: 1638
I'm trying to run my flutter application after added onesignal_flutter: ^3.2.8
on my pubspec.yaml
. I got this error:
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not resolve com.google.firebase:firebase-messaging:{require [19.0.0, 22.0.99]; prefer 22.0.0}. Required by: project :app > project :onesignal_flutter > com.onesignal:OneSignal:4.6.6 > Failed to list versions for com.google.firebase:firebase-messaging. > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml. > Could not get resource 'https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml'. > Could not GET 'https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
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 2m 47s [!] Gradle threw an error while downloading artifacts from the network. Retrying to download... Exception: Gradle task assembleDebug failed with exit code 1```
Upvotes: 0
Views: 480
Reputation: 562
Add the following lines to your android/app/build.gradle
buildscript {
repositories {
// ...
mavenCentral()
}
dependencies {
// ...
// OneSignal-Gradle-Plugin
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.10, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
You can also refer to One Signal documentation for more info.
Upvotes: 0