简体   繁体   中英

Simple Cordova app with just Firebase plugin doesn't build or run on Android

I made a very simple Cordova project, added the Android platform and the Firebase plugin. I can't get it to build or run. I get errors after errors.

Here are the steps:

  1. cordova create hello com.example.hello Hello
  2. cordova platform add android
  3. cordova plugin add cordova-plugin-firebase

Or, just download the code from: https://github.com/abelabbesnabi/cordova.git

I have the following environment:

  1. Cordova 9.0.0

  2. Android Studio 3.5 Build #AI-191.8026.42.35.5791312, built on August 8, 2019 JRE: 1.8.0_202-release-1483-b03 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains sro

  3. Windows 10 10.0

Any idea please?

change cordova plugin add cordova-plugin-firebase with

cordova plugin add cordova-plugin-firebasex

another option is after adding cordova-plugin-firebase add 2 another plugin

cordova-android-play-services-gradle-release

cordova-android-firebase-gradle-release

Here are the steps to make it work:

  1. cordova platform remove android
  2. cordova plugin remove cordova-plugin-firebase
  3. cordova plugin add cordova-plugin-firebase-lib
  4. cordova plugin add cordova-plugin-androidx
  5. cordova plugin add cordova-plugin-androidx-adapter

That's it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM