0

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 s.r.o

  3. Windows 10 10.0

Any idea please?

abelabbesnabi
  • 1,819
  • 1
  • 16
  • 21

2 Answers2

0

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

  • It doesn't work, unfortunately. I'm getting these errors: Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0) and classes.jar (com.android.support:support-compat:27.1.1) and many more duplicate errors... – abelabbesnabi Sep 10 '19 at 19:29
  • Did you try changing gradle.properties file https://stackoverflow.com/questions/55909804/duplicate-class-android-support-v4-app-inotificationsidechannel-found-in-modules/55932544 – user10397650 Sep 11 '19 at 15:28
0

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!

abelabbesnabi
  • 1,819
  • 1
  • 16
  • 21