0

ionic cordova build android --prod

This is the error:

What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

https://developers.google.com/android/guides/releases

The latest update to Google Play services and Firebase includes the following changes:

Migration from Android Support Libraries to Jetpack (AndroidX) Libraries. Libraries will not work unless you make the following changes in your app:

Upgrade com.android.tools.build:gradle to v3.2.1 or later. Upgrade compileSdkVersion to 28 or later. Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX. Firebase Bill of Materials (BoM)

Due to the above android SDK change, I cannot build the APK now. I have tried many solutions. But no luck yet. Any clue here?

I have tried this. But it is not working:

build.gradle

project.ext {
  defaultBuildToolsVersion="28.0.0" //String
  defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
  defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
  defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
}

project.properties

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.gradle.include.1=cordova-plugin-firebase/stella-build.gradle
cordova.system.library.2=com.google.android.gms:play-services-tagmanager:16.0.8
cordova.system.library.3=com.google.firebase:firebase-core:16.0.8
cordova.system.library.4=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.5=com.google.firebase:firebase-config:16.4.1
cordova.system.library.6=com.google.firebase:firebase-perf:16.2.4
cordova.system.library.7=com.android.support:support-annotations:28.+

Tried this too. But no luck? i.e. ionic cordova platform add [email protected]

$ ionic cordova platform add [email protected]
> cordova.cmd platform add [email protected] --save
Using cordova-fetch for [email protected]
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.tt.la
        Name: la
        Activity: MainActivity
        Android target: android-28
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Subproject Path: CordovaLib
Subproject Path: app
Subproject Path: CordovaLib
Subproject Path: app
Error during processing of action! Attempting to revert...
Uh oh!
ENOENT: no such file or directory, open '\platforms\android\app\src\main\AndroidManifest.xml'

1 Answer 1

2

Good news! This is how I have sorted out my issue. It is working fine now.

Note: My problem here was with the Firebase plugin: https://github.com/arnesson/cordova-plugin-firebase

Solution:

1. ionic cordova platform rm android    

2. ionic cordova plugin rm cordova-plugin-firebase

3. ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue 

4. ionic cordova plugin add cordova-plugin-androidx

5. ionic cordova plugin add cordova-plugin-androidx-adapter

6. ionic cordova platform add android

7.ionic cordova build android --prod

Ref: Git Issue

Sign up to request clarification or add additional context in comments.

1 Comment

@Pouloulou You can check other solutions here: github.com/arnesson/cordova-plugin-firebase/issues/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.