Ionic framework 在Ionic项目中安装FCM插件时出错

Ionic framework 在Ionic项目中安装FCM插件时出错,ionic-framework,firebase-cloud-messaging,Ionic Framework,Firebase Cloud Messaging,我正在尝试使用前面描述的fcm插件,在安装之后,我现在无法为Android构建。我认为这是依赖性的问题,我在Stack Overflow和Ionic论坛上尝试了所有方法,并在那里发布了我的问题 我是一个离子初学者 错误是: FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

我正在尝试使用前面描述的fcm插件,在安装之后,我现在无法为Android构建。我认为这是依赖性的问题,我在Stack Overflow和Ionic论坛上尝试了所有方法,并在那里发布了我的问题

我是一个离子初学者

错误是:

FAILURE: Build failed with an exception.

* What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
     Required by:
         project :app > com.google.android.gms:play-services-identity:15.0.1
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
   > Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
     Required by:
         project :app > com.google.android.gms:play-services-identity:15.0.1
      > Failed to list versions for com.google.android.gms:play-services-basement.
         > Unable to load Maven meta-data from https ://jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml.
            > Could not get resource 'https: //jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml'.
               > Could not GET 'https: //jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml'.
                  > Read timed out

* 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 43s E:\Projects\DeliveryFamily-11-4-2020-START\platforms\android\gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

* What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve com.google.android.gms:play-services-base:[15.0.1,16.0.0).
     Required by:
         project :app > com.google.android.gms:play-services-identity:15.0.1
      > Skipped due to earlier error
      > Skipped due to earlier error
      > Skipped due to earlier error
   > Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
     Required by:
         project :app > com.google.android.gms:play-services-identity:15.0.1
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml.
            > Could not get resource 'https: //jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml'.
               > Could not GET 'https://jcenter.bintray.com/com/google/android/gms/play-services-basement/maven-metadata.xml'.
                  > Read timed out

* 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.

BUILD FAILED in 43s [ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --device exited with exit code 1.
我的依赖项是:

"dependencies": {
    "@angular/common": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/core": "~8.1.2",
    "@angular/fire": "^5.2.3",
    "@angular/forms": "~8.1.2",
    "@angular/platform-browser": "~8.1.2",
    "@angular/platform-browser-dynamic": "~8.1.2",
    "@angular/router": "~8.1.2",
    "@capacitor/core": "1.2.1",
    "@ionic-native/camera": "^5.16.0",
    "@ionic-native/clipboard": "^5.22.0",
    "@ionic-native/core": "^5.16.0",
    "@ionic-native/crop": "^5.16.0",
    "@ionic-native/facebook": "^5.23.0",
    "@ionic-native/fcm": "^5.23.0",
    "@ionic-native/file": "^5.23.0",
    "@ionic-native/file-path": "^5.16.0",
    "@ionic-native/firebase": "^5.22.0",
    "@ionic-native/globalization": "^5.0.0",
    "@ionic-native/google-plus": "^5.23.0",
    "@ionic-native/image-picker": "^5.16.0",
    "@ionic-native/ionic-webview": "^5.16.0",
    "@ionic-native/splash-screen": "^5.16.0",
    "@ionic-native/status-bar": "^5.16.0",
    "@ionic/angular": "^4.11.5",
    "@ionic/storage": "^2.2.0",
    "@ngrx/effects": "^8.5.1",
    "@ngrx/entity": "^8.5.1",
    "@ngrx/store": "^8.5.1",
    "@ngx-translate/core": "^12.1.2",
    "@ngx-translate/http-loader": "^4.0.0",
    "angularfire": "^2.3.0",
    "cordova-android": "^8.1.0",
    "cordova-clipboard": "^1.3.0",
    "cordova-plugin-androidx": "^1.0.2",
    "cordova-plugin-androidx-adapter": "^1.1.0",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-buildinfo": "^4.0.0",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-crop": "^0.4.0",
    "cordova-plugin-customurlscheme": "^5.0.1",
    "cordova-plugin-facebook4": "^6.4.0",
    "cordova-plugin-fcm-with-dependecy-updated": "^4.6.1",
    "cordova-plugin-file": "^6.0.2",
    "cordova-plugin-filepath": "^1.5.6",
    "cordova-plugin-firebasex": "^9.0.2-cli",
    "cordova-plugin-globalization": "^1.11.0",
    "cordova-plugin-googleplus": "8.4.0",
    "cordova-plugin-inappbrowser": "^3.2.0",
    "cordova-plugin-ionic-webview": "^4.1.3",
    "cordova-plugin-telerik-imagepicker": "^2.3.3",
    "cordova-sqlite-storage": "^5.0.0",
    "cordova-universal-links-plugin": "^1.2.1",
    "cordova-universal-links-plugin-fix": "^1.2.1",
    "core-js": "^2.6.10",
    "firebase": "^6.6.2",
    "ngx-clipboard": "^12.3.0",
    "promise-polyfill": "8.1.3",
    "rxjs": "^6.5.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.801.2",
    "@angular-devkit/build-angular": "^0.803.24",
    "@angular-devkit/core": "~8.1.2",
    "@angular-devkit/schematics": "~8.1.2",
    "@angular/cli": "~8.1.2",
    "@angular/compiler": "~8.1.2",
    "@angular/compiler-cli": "~8.1.2",
    "@angular/language-service": "~8.1.2",
    "@capacitor/cli": "1.2.1",
    "@ionic/angular-toolkit": "~2.0.0",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.2.0",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "^4.4.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "node-sass": "^4.13.1",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-filepath": {},
      "cordova-plugin-telerik-imagepicker": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-globalization": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-clipboard": {},
      "cordova-plugin-crop": {},
      "cordova-sqlite-storage": {},
      "cordova-plugin-file": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "1400.....416",
        "APP_NAME": "F.....ry",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.13.0"
      },
      "cordova-plugin-buildinfo": {},
      "cordova-plugin-browsertab": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-customurlscheme": {
        "URL_SCHEME": "......@gmail.com",
        "ANDROID_SCHEME": " ",
        "ANDROID_HOST": " ",
        "ANDROID_PATHPREFIX": "/"
      },
      "cordova-plugin-googleplus": {
        "REVERSED_CLIENT_ID": "5220........nt.com",
        "PLAY_SERVICES_VERSION": "15.0.1"
      },
      "cordova-plugin-androidx": {},
      "cordova-plugin-androidx-adapter": {},
      "cordova-plugin-firebasex": {},
      "cordova-universal-links-plugin": {},
      "cordova-plugin-fcm-with-dependecy-updated": {
        "FCM_VERSION": "19.0.0",
        "GRADLE_TOOLS_VERSION": "3.5.3",
        "GOOGLE_SERVICES_VERSION": "4.3.3",
        "SUPPORT_LIBRARY_VERSION": "28.0.0",
        "ANDROID_DEFAULT_NOTIFICATION_ICON": "@mipmap/ic_launcher"
      }
    },
    "platforms": [
      "android"
    ]
  }
}
爱奥尼亚信息:

离子型:

爱奥尼亚CLI:6.3.0 (C:\Users\user\AppData\Roaming\npm\node_modules@ionic\cli)离子型 框架:@ionic/angular 4.11.5
@角度devkit/构建角度:0.803.24@角度devkit/示意图 :8.1.3@angular/cli:8.1.3
@离子/角度工具包:2.0.0

电容器:

电容器CLI:1.2.1@电容器/铁芯:1.2.1

科尔多瓦:

Cordova CLI:9.0.0(Cordova-lib@9.0.1)科尔多瓦平台 :android 8.1.0 Cordova插件:Cordova插件离子键盘 2.2.0,cordova插件ionic webview 4.1.3,(和22个其他插件)

实用程序:

cordova res:0.10.0本地运行:0.3.0

系统:

NodeJS:v12.16.1(C:\Program Files\NodeJS\node.exe)npm: 6.13.4操作系统:Windows 10


注意:我已经删除了fcm插件并使用了firebasex,但是有相同的错误,然后我按照以下步骤解决了它:

  • 命令:离子修复

  • 我只需将minsdkversion设置为21就启用了multidex(如果所需的minsdk小于我提到的值,您可以用其他方法启用它)。 然后尝试了ionic cordova插件cordova插件fcm,更新了dependecy并成功:)


  • 注意:我已经删除了fcm插件并使用了firebasex,但是有相同的错误,然后我按照以下步骤解决了它:

  • 命令:离子修复

  • 我只需将minsdkversion设置为21就启用了multidex(如果所需的minsdk小于我提到的值,您可以用其他方法启用它)。 然后尝试了ionic cordova插件cordova插件fcm,更新了dependecy并成功:)