Ionic 3 app build failed to execute aapt

#1

Hello guys ,

i want to make login with facebook at my ionic 3 app ,

so i followed this Tutorial

and did every step of it , now when i want to build the app so i get apk file . it will failed always
so please if you have any idea how to fix this and still use Facebook login let me know :slight_smile:
this is my environment info

cli packages: (C:\Users\ahkhalaf\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v6.9.1
npm               : 3.10.8
OS                : Windows 10

Environment Variables:

ANDROID_HOME : C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows

Misc:

backend : pro

this is my error below

[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: 'D:\\MOBILE\\YallaNtosh', local: false, binPath:
        'C:\\Users\\ahkhalaf\\AppData\\Roaming\\npm\\node_modules\\ionic\\bin\\ionic', libPath:
        'C:\\Users\\ahkhalaf\\AppData\\Roaming\\npm\\node_modules\\ionic\\dist\\index.js' }
[DEBUG] Daemon found (pid: 9248)
Running app-scripts build: --prod --platform android --target cordova
[09:53:37]  build prod started ...
[09:53:37]  clean started ...
[09:53:38]  clean finished in 10 ms
[09:53:38]  copy started ...
[09:53:38]  deeplinks started ...
[09:53:38]  deeplinks finished in 252 ms
[09:53:38]  ngc started ...
Warning: Can't resolve all parameters for Settings in D:/MOBILE/YallaNtosh/src/providers/settings/settings.ts: ([object Object], ?). This will become an error in Angular v6.x
Warning: Can't resolve all parameters for Settings in D:/MOBILE/YallaNtosh/src/providers/settings/settings.ts: ([object Object], ?). This will become an error in Angular v6.x
[09:53:51]  ngc finished in 12.86 s
[09:53:51]  preprocess started ...
[09:53:51]  preprocess finished in 3 ms
[09:53:51]  webpack started ...
[09:54:01]  copy finished in 23.71 s
[09:55:00]  webpack finished in 69.32 s
[09:55:00]  uglify started ...
[09:55:00]  sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[09:55:02]  sass finished in 1.67 s
[09:55:02]  cleancss started ...
[09:55:03]  cleancss finished in 1.66 s
[09:55:35]  uglify finished in 34.78 s
[09:55:35]  postprocess started ...
[09:55:35]  postprocess finished in 32 ms
[09:55:35]  lint started ...
[09:55:35]  build prod finished in 117.56 s
> cordova build android --release
Android Studio project detected

ANDROID_HOME=C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_111
studio
[09:55:39]  lint finished in 4.14 s
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_31ovftfbpbo3w4wt10mftj2c5.run(D:\MOBILE\YallaNtosh\platforms\android\app\build.gradle:143)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
:CordovaLib:preBuild
UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:prepareLintJar UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:platformAttrExtractor UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:javaPreCompileRelease UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac
 UP-TO-DATE
:CordovaLib:processReleaseJavaRes

NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease
 UP-TO-DATE
:app:preBuild
 UP-TO-DATE
:app:preReleaseBuild
 UP-TO-DATE
:app:compileReleaseAidl UP-TO-DATE
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:app:compileReleaseRenderscript UP-TO-DATE
:app:checkReleaseManifest UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateReleaseResValues
 UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources

UP-TO-DATE
:app:createReleaseCompatibleScreenManifests
 UP-TO-DATE
:app:processReleaseManifest

UP-TO-DATE
:app:splitsDiscoveryTaskRelease UP-TO-DATE
:app:processReleaseResources
\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:47:28-45: AAPT: No resource found that matches the given name (at 'value' with value '@string/fb_app_id').

\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:50:28-47: AAPT: No resource found that matches the given name (at 'value' with value '@string/fb_app_name').

\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:55:28-47: AAPT: No resource found that matches the given name (at 'label' with value '@string/fb_app_name').

\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:45: error: Error: No resource found that matches the given name (at 'value' with value '@string/fb_app_id').

\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:48: error: Error: No resource found that matches the given name (at 'value' with value '@string/fb_app_name').

\\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml:52: error: Error: No resource found that matches the given name (at 'label' with value '@string/fb_app_name').


Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:796)
        at com.android.build.gradle.tasks.ProcessAndroidResources.invokeAaptForSplit(ProcessAndroidResources.java:551)
        at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:285)
        at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:109)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
 FAILED
25 actionable tasks: 1 executed, 24 up-to-date

        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows\build-tools\27.0.3\aapt.exe with arguments {package -f --no-crunch -I C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows\platforms\android-26\android.jar -M \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml -S D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\res\merged\release -m -J \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\generated\source\r\release -F D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\res\release\resources-release.ap_ --custom-package com.ionicframework.YallaNtosh -0 apk --output-text-symbols \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\symbols\release --no-version-vectors}
        at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)
        at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:79)
        at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:794)
        ... 48 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows\build-tools\27.0.3\aapt.exe with arguments {package -f --no-crunch -I C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows\platforms\android-26\android.jar -M \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\manifests\full\release\AndroidManifest.xml -S D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\res\merged\release -m -J \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\generated\source\r\release -F D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\res\release\resources-release.ap_ --custom-package com.ionicframework.YallaNtosh -0 apk --output-text-symbols \\?\D:\MOBILE\YallaNtosh\platforms\android\app\build\intermediates\symbols\release --no-version-vectors}
        at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:73)
        at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:48)
        at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
        at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
        at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1237)
        at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
        at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:911)
        at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:822)
        at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:664)
        at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:48)
        at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:58)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\android-sdk_r24.4.1-windows\android-sdk-windows\build-tools\27.0.3\aapt.exe'' finished with non-zero exit value 1
        at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:380)
        at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:46)
        ... 9 more

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
Ionic 2 or 3 Error: Failed to execute aapt
#2

Fixed when i downgrade my android from 7.0.0 to 6.3.0

ionic cordova platform add android@6.3.0

3 Likes
#3

(node:14104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Platform android already added.
(node:14104) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Not solved Still its showing same error

  • What went wrong:
    Execution failed for task ‘:app:processDebugResources’.

Failed to execute aapt

#4

I am having same issues. Any luck?