説明:
ドキュメントに従ってreact-native-onesignalをインストールしました。 iOSでは問題なく動作しますが、GooglePlayサービスの依存関係に関連してAndroid側で問題が発生しています。 4.2.0から4.1.0にグーグルサービスにダウングレードするとうまくいくようですが、残念ながら、ダウングレードすると他のいくつかの依存関係が壊れます。
この問題がAndroid側のいくつかの場所で記録されているのを確認しました。これにより、このreact-nativeライブラリでサポートされているAndroidSDKの最新バージョンに問題があると思われます。
https://github.com/OneSignal/OneSignal-Android-SDK/issues/894
https://stackoverflow.com/questions/59128152/error-in-project-app-a-resolved-google-play-services-library-dependency-depen
これが私が受け取っているエラーです:
> 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.3 -> com.google.android.gms:play-services-location@[10.2.1, 16.0.99], b
ut play-services-location version was 15.0.1.
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 onto com.google.android.gms:play-services-location@{strictly 15.0.1}
-- Project 'app' depends onto com.onesignal:OneSignal@{strictly 3.12.3}
-- Project 'app' depends on project 'react' which depends onto com.onesignal:[email protected]
環境
問題を再現する手順:
buildscript {
...
repositories {
...
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
...
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
classpath 'com.google.gms:google-services:4.2.0'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
react-native run-android
他に何か:
私も同じ問題を抱えています。
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> 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.3 -> com.google.android.gms:play-services-location@[10.2.1, 16.0.99], b
ut play-services-location version was 16.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 onto com.google.android.gms:play-services-location@{strictly 16.0.0}
-- Project 'app' depends onto com.onesignal:OneSignal@{strictly 3.12.3}
-- Project 'app' depends on project 'react' which depends onto com.onesignal:[email protected]
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 15s
@Esireiどのバージョンのreact-native-onesignalを使用していますか?
3.6.1の同じ問題:
* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> 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.4 -> com.google.android.gms:play-services-location@[10.2.1, 16.0.99], b
ut play-services-location version was 15.0.1.
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 onto com.google.android.gms:play-services-location@{strictly 15.0.1}
-- Project 'app' depends onto com.onesignal:OneSignal@{strictly 3.12.4}
-- Project 'app' depends on project 'react' which depends onto com.onesignal:[email protected]
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.
3.4.2にダウングレードすると、問題が修正されます。
OneSignal Gradleプラグインの最新バージョンを使用していることを確認できますか?
@rgomezpOneSignalgradleプラグインの3.12.4バージョンを含む最新のonesignalバージョンをインストールしてみました。 ただし、それでもエラーが発生しました。
3.12。* AndroidSDKはgoogle-services4.2と互換性がないようです。
androidappbuild.gradleでgoogle-servicesの前にonesignal-gradle-pluginを宣言してみてください。
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.google.gms.google-services'
@alluminaが上で述べたように、ドキュメントに従ってappbuild.gradleファイルを編集する必要があります。
@Esireiどのバージョンのreact-native-onesignalを使用していますか?
v3.6.1
これは今のところ解決されているようです。 皆様のご参加ありがとうございました
@rgomezpこれが修正されたとは思わない。 ここにいる全員が、ダウングレードなどの回避策を見つけました。 これはまだ非常に問題だと思います。
「最新バージョンをインストールしてください」以外のOneSignalからの応答はありませんが、役に立ちませんでした。
@rgomezpOneSignalgradleプラグインの3.12.4バージョンを含む最新のonesignalバージョンをインストールしてみました。 ただし、それでもエラーが発生しました。
3.12。* AndroidSDKはgoogle-services4.2と互換性がないようです。
@cmcaboy OneSignal Gradleプラグインは、 OneSignal Android Native SDKのコンポーネントから独立しており、自動的には含まれません。
React NativeOneSignalセットアップガイドの「Gradleプラグインの
androidappbuild.gradleでgoogle-servicesの前にonesignal-gradle-pluginを宣言してみてください。
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.google.gms.google-services'
ありがとうそれは私のために働きます。
app / build.gradleに、次の行を追加しました。
プラグイン{
id'com.onesignal.androidsdk.onesignal-gradle-plugin 'バージョン' 0.12.6 '
}
androidappbuild.gradleでgoogle-servicesの前にonesignal-gradle-pluginを宣言してみてください。
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.google.gms.google-services'
@アルミナ
私のために働きます。 ありがとう
プラグインを適用します: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
プラグインを適用する: 'com.google.gms.google-services'
@アルミナ
私のために働きます。 ありがとう☺️👍
私はまだ問題を経験しています、上記の解決策は私のために機能しませんでした、誰かが彼/彼女のgradleファイル全体を共有できますか?
最も参考になるコメント
androidappbuild.gradleでgoogle-servicesの前にonesignal-gradle-pluginを宣言してみてください。
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.google.gms.google-services'