【问题标题】:Error with push plugin error string resource id #0x0推送插件错误字符串资源 ID #0x0 出错
【发布时间】:2020-03-07 03:58:36
【问题描述】:

我正在使用 Angular 8 和 Ionic 4 进行应用程序开发
我的应用程序已完成并正在更新中
在更新中,我正在尝试添加推送通知,以便获取 android 设备的注册 ID,
我正在使用 ionic doc 链接:https://ionicframework.com/docs/native/push
来自 Doc 的命令:ionic cordova plugin add phonegap-plugin-push

安装上述命令后,我注意到它在下面的路径中添加了更多库
路径:/app/platforms/android/project.properties

安装前

target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-annotations:27.+
cordova.gradle.include.1=cordova-plugin-googlemaps/ecommerce-tbxml-android.gradle
cordova.gradle.include.2=cordova-plugin-googlemaps/ecommerce-pgm-custom.gradle
cordova.system.library.3=com.android.support:support-v4:24.1.1+
cordova.system.library.4=com.razorpay:checkout:1.5.12
cordova.system.library.5=com.google.android.gms:play-services-analytics:11.0.1

安装后

target=android-28
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-annotations:27.+
cordova.gradle.include.1=cordova-plugin-googlemaps/ecommerce-tbxml-android.gradle
cordova.gradle.include.2=cordova-plugin-googlemaps/ecommerce-pgm-custom.gradle
cordova.system.library.3=com.android.support:support-v4:24.1.1+
cordova.system.library.4=com.razorpay:checkout:1.5.12
cordova.system.library.5=com.google.android.gms:play-services-analytics:11.0.1

cordova.gradle.include.3=cordova-support-google-services/rostail-build.gradle
cordova.gradle.include.4=phonegap-plugin-multidex/rostail-multidex.gradle
cordova.system.library.6=com.android.support:support-v13:27.+
cordova.system.library.7=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.8=com.google.firebase:firebase-messaging:17.0.+

由于这个文件更改,我在命令下运行时遇到了一些版本冲突错误
命令: ionic cordova run android
我正在使用此命令将应用程序调试到我的设备中,想要检查注册 ID 是否正在获取
但我遇到了问题

FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
  1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-stats:15.0.1 -> com.google.android.gms:play-services-basement@[
  15.0.1], but play-services-basement version was 16.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.firebase:firebase-common@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-measurement-connector@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-basement@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-iid@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-places-placereport@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-tasks@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-location@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-maps@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.+
  -- Project 'app' depends onto com.google.android.gms:play-services-stats@15.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.0

  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 19s
3 actionable tasks: 1 executed, 2 up-to-date
/var/www/html/apps/app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture fingerprint of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
  1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-stats:15.0.1 -> com.google.android.gms:play-services-basement@[
  15.0.1], but play-services-basement version was 16.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.firebase:firebase-common@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-measurement-connector@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-basement@16.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-iid@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-places-placereport@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-tasks@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-location@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-iid-interop@16.0.0
  -- Project 'app' depends onto com.google.android.gms:play-services-base@16.0.1
  -- Project 'app' depends onto com.google.android.gms:play-services-maps@16.0.0
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.+
  -- Project 'app' depends onto com.google.android.gms:play-services-stats@15.0.1
  -- Project 'app' depends onto com.google.firebase:firebase-messaging@17.0.0

  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 19s
[ERROR] An error occurred while running subprocess cordova.

        cordova build android --device exited with exit code 1.

        Re-running this command with the --verbose flag may provide more
        information.

如果我在 project.properties 中评论以下行,那么它会在我的设备中安装应用程序,但在尝试从设备获取注册 ID 时出现错误:“错误字符串资源 id #0x0”。

cordova.gradle.include.3=cordova-support-google-services/rostail-build.gradle

【问题讨论】:

    标签: angular ionic-framework push


    【解决方案1】:

    终于在 2 天后我得到了解决方案并且它对我有用:)!!

    我在下面的路径中更改了 play-services-analytics 的版本
    路径:platforms/android/project.properties
    cordova.system.library.3=com.google.android.gms:play-services-analytics:11.0.1

    cordova.system.library.3=com.google.android.gms:play-services-analytics:17.0.0
    并关注以下论坛
    https://forum.ionicframework.com/t/d8-program-type-already-present/166812/4

    【讨论】:

      【解决方案2】:

      我遇到了同样的错误,但在尝试 @user3709901 解决方案之前,我尝试再次删除并添加平台,错误得到了解决。

      错误: Error with push plugin error string resource id #0x0

      解决方案:

      cordova platform remove android
      
      cordova platform add android
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-08-16
        • 1970-01-01
        • 2023-01-21
        • 1970-01-01
        • 2020-02-28
        • 1970-01-01
        • 2021-06-02
        相关资源
        最近更新 更多