Столкновение флаттера OneSignal с геолокатором - PullRequest
1 голос
/ 29 января 2020

Приложение, которое я создаю, нуждается в геолокации и однонаправленном сигнале, геолокация работает нормально, но синглсигнал включает в себя следующую ошибку:

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[10.2.
  1, 16.0.99]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.       

  Dependency failing: com.onesignal:OneSignal:3.12.5 -> com.google.android.gms:play-services-location@[10.2.1, 16.0.99], b
  ut play-services-location version was 17.0.0.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends on project 'geolocator' which depends onto com.google.android.gms:play-services-location@16.0.0
  -- Project 'app' depends onto com.onesignal:OneSignal@3.12.5
  -- Project 'app' depends onto com.onesignal:OneSignal@{strictly 3.12.5}
  -- Project 'app' depends onto com.google.android.gms:play-services-location@{strictly 17.0.0}
  -- Project 'app' depends on project 'google_api_availability' which depends onto com.google.android.gms:play-services-lo
  cation@17.0.0
  -- Project 'app' depends on project 'onesignal_flutter' which depends onto com.onesignal:OneSignal@3.12.5

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* 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 3m 5s

Вот что я добавил для синглсигнала в build.gradle android:

buildscript {
    ext.kotlin_version = '1.3.50'
    repositories {
        google()
        jcenter()
        maven { url 'https://plugins.gradle.org/m2/'} // Gradle Plugin Portal
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.2'
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.4, 0.99.99]'

    }
}

Вот уровень приложения build.gradle:

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
    api 'com.onesignal:OneSignal:3.12.5'
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

Вот pubspe c:

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^0.1.2
  firebase_auth: ^0.15.3+1
  cloud_firestore: ^0.13.0+1
  provider: ^4.0.2
  flutter_spinkit: ^4.1.1+1
  bottom_navy_bar: ^3.0.0
  contacts_service: ^0.3.9
  permission_handler: ^4.0.0
  spinner_input: ^0.1.2
  datetime_picker_formfield: ^0.4.3
  font_awesome_flutter: ^8.5.0
  transformer_page_view: ^0.1.6
  image_picker: ^0.6.2+3
  flushbar: ^1.9.1
  intl: ^0.15.5
  flutter_native_timezone: ^1.0.2
  timezone: ^0.5.2
  simple_gesture_detector: ^0.1.3
  flutter_launcher_icons: ^0.7.2+1
  geolocator: ^5.1.5
  synchronized: ^2.1.1
  firebase_core: ^0.4.0
  flutter_email_sender: ^2.2.2
  onesignal_flutter: ^2.3.2

Я уже сделал версию min SDK 21, изменил версии версии один и тот же на более старые и новые ничего не работает. Пожалуйста, помогите им только младший разработчик

1 Ответ

0 голосов
/ 29 января 2020

Измените это:

        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.4, 0.99.99]'

на это:

        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
...