任务':app:processDebugResources'的执行失败。无法执行Aapt Ionic 4 Android

时间:2019-06-18 22:56:45

标签: android angular ionic4

ionic cordova build android --prod

这是错误:

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

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

  

Google Play服务和Firebase的最新更新包括   进行以下更改:

     

从Android支持库迁移到Jetpack(AndroidX)   图书馆。除非您进行以下操作,否则图书馆将无法工作   您的应用中的更改:

     

将com.android.tools.build:gradle升级到v3.2.1或更高版本。升级   compileSdkVersion到28或更高版本。更新您的应用程序以使用Jetpack   (AndroidX);按照迁移到AndroidX中的说明进行操作。火力基地   物料清单(BoM)

由于上述android SDK更改,我现在无法构建APK。我尝试了许多解决方案。但是还没有运气。这里有任何线索吗?

我已经尝试过了。但这不起作用:

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.+

也尝试过这个。但是没有运气吗?即ionic cordova platform add android@8.0.0

$ ionic cordova platform add android@8.0.0
> cordova.cmd platform add android@8.0.0 --save
Using cordova-fetch for cordova-android@8.0.0
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 cordova-android@8.0.0
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 个答案:

答案 0 :(得分:2)

好消息!这就是我解决问题的方式。现在工作正常。

注意:我的问题是使用 Firebase插件 https://github.com/arnesson/cordova-plugin-firebase

解决方案:

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

参考:Git Issue