0

I am trying to build an android app in ionic 3, but when i execute 'ionic cordova build android' i have the error: Execution failed for task ':app:processDebugResources'. > Failed to execute aapt I am using some plugins like firebase

I already tryed to make some changes in build.gradle like add: configurations.all; change the position of jcenter(), create a build-extra.gradle and remove the platform But none of it works, please help

Here my build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' } // Fabrics Maven repository from cordova-plugin-firebase
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    dependencies {

        configurations.all {
            resolutionStrategy.force 'com.android.support:support-v4:24.0.0'
        }

        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:4.1.0' // google-services dependency from cordova-plugin-firebase
        classpath 'io.fabric.tools:gradle:1.25.4' // fabric dependency from cordova-plugin-firebase
    }
}

allprojects {
    repositories {
        google() // Google's Maven repository from cordova-plugin-firebase
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    //This replaces project.properties w.r.t. build settings
    project.ext {
      defaultBuildToolsVersion="25.0.2" //String
      defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
      defaultTargetSdkVersion=26 //Integer - We ALWAYS target the latest by default
      defaultCompileSdkVersion=26 //Integer - We ALWAYS compile with the latest by default
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Before i make some changes, i've got an error with support-android-v4

2 Answers2

0

I am sure you ckecked on StackOverFlow some solutions about that, but we have not enought data to fix that. Related to other similar post, did you tried the following changes :

Just put following in build-extras.gradle

configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }
}

See more here : https://stackoverflow.com/a/49174659/11552516

MagicaNexus
  • 312
  • 2
  • 8
0

Google just released a major update which requires a minimum sdkversion=28. Because of this you need to update the android cordova platform to 8.0.0. you can use the command line by removing the existing platform

cordova platform remove android

and adding the new one

cordova platform add android@8.0.0

Once the new platform is there then the easiest way to migrate is open the android platform in android studio. In the top menu bar there is a tab called and choose refactor-->Migrate to AndroidX. This should fix all the instances of class paths being changed from the newest google update.

One final thing is to add these next lines in the gradle.properities file of the android project

android.useAndroidX=true
android.enableJetifier=true