Ionic Cordova app stopped compiling after Google's June 17th Firebase SDK update

后端 未结 10 1498
花落未央
花落未央 2020-11-28 06:54

I\'m unable to compile Ionic Cordova App after Firebase Major version update with Breaking Changes, specifically with June 17, 2019 update.

I tried downgrading to An

10条回答
  •  醉话见心
    2020-11-28 07:37

    Follow these steps if you have tried everything and you cannot build your cordova android project yet.

    I've been working on this issue for five days and this is the only solution that works for me (it's a recopilation of solutions and comments, ordered in the sequence I followed to make my projects work):

    1. Install the latest cordova version (cordova@9.0.0):

      npm install -g cordova

    2. Create a new blank cordova project (use the same reverse domain and project name):

      cordova create folderName com.projectName.app projectName

    3. Add the latest cordova-android platform (cordova-android@8.0.0):

      cordova platform add android

    4. Install every plugin that appears on your original project (except cordova-plugin-firebase). I would recomend you to build your app after each plugin installation to check if everything is OK.

    5. Install cordova-plugin-firebase-lib

      cordova plugin add cordova-plugin-firebase-lib

    6. Install cordova-plugin-androidx

      cordova plugin add cordova-plugin-androidx

    7. Install cordova-plugin-androidx-adapter

      cordova plugin add cordova-plugin-androidx-adapter

    8. Copy the firebase settings files to the root of your project: google-services.json for Android and GoogleService-Info.plist for iOS

    9. Copy resources tags (for icons and splash screens) from your old config.xml and paste them into your new config.xml.

    
        
        
        
        
        
    
    
        
        
        
        
        
        
        
        
        
        
        
    

    1. Copy your old res folder to the root of your project (the folder that has all your icons and splash screens).

    2. Replace the content of your new /www folder with the content of the original one.

    3. Finally, build your project

      cordova build android

    In my case, I had two plugins that were in conflict with the new cordova, cordova-android, firebase sdk versions: cordova-plugin-firebase and cordova-plugin-locationservices, and these steps let me continue with my projects.

提交回复
热议问题