I read the documentation about the use of aapt2 here. In particular the Compile section.
I have a decompiled AndroidManifest.xml file (with apktool) from some application and now I want to re-compile it back.
When I am using aapt2 to do it like that:
C:\Users\myuser\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt2.exe compile C:\tmp\AndroidManifest.xml -o c:\tmp\compiled_folder
It is failed with the error:
error: invalid file path 'C:\tmp\AndroidManifest.xml'.
Why it writes me that the file is invalid ? it's a regular XMLfile.
I needed to use only files from the resource folder because it supports only resource files:
https://developer.android.com/guide/topics/resources/available-resources
And AndroidManifest.xml is not consider as resource.
Related
I want to build aab to upload CH Play but it always fails and shows a message:
Execution failed for task ':app:packageReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'root/res/drawable-hdpi/ic_launcher.png' uses reserved file or directory name 'res'.
I tried to search ic_launcher.png but my app does not use that name.
Note: I added 'ic_launcher.png' in the folder drawable but it still errors.
Please help me with this issue. Thanks in advance!
'res' is android application reserved directory name, try to change 'root/res' for another name
I suspect you depend on a jar which should be an aar.
Jars don't have the concept of Android resources, so when the app bundle is built, it would consider the "res" directory as a a regular directory that would thus be packaged under "root".
Resources can be packaged in aar files, which would then be packaged properly.
While trying to use aapt2 to link some resources, I got this error message error: resource drawable/googleg_standard_color_18 (aka com.google.android.gms.auth.api:drawable/googleg_standard_color_18) not found. and other similar messages about some files not found.
Where can I find these resource files that aapt2 needs?
The error about the resource not found in your project which you are trying to use.
put the needed icon or resource in your drawable folder and try to use it.
i tried to create an app widget.. i can run the widget in emulator.. but i cann't build it as apk file
Below is the error
Android resource linking failed
Output:
F:\me\Workspace\example\base\build\intermediates\merged_manifests\
debugFeature\processDebugFeatureManifest\merged\AndroidManifest.xml:102:
error: resource xml/ptcwidget_info (aka com.example.app:xml/widget_info)
not found.
error: failed processing manifest.
but this widget_info.xml is under UIModule.. this merged manifest file is not finding xml folder under resources
Check gradle implementations, if you did add library it can be merge. Or try rename the xml file and sync project with gradle file.Files may be overlapped
Error:Execution failed for task ':app:mergeDebugResources'.
C:\Users\user\AndroidStudioProjects\BrainTrain\app\src\main\res\mipmap-hdpi\USER-PC.eml: Error: The file name must end with .xml or .png
This error as been occurring ever after closing my Android studio
You put a file, named USER-PC.eml in res/mipmap-hdpi/. That is not a valid filename for that directory (wrong extension, dashes not allowed), and quite possibly it is not a valid file for that directory.
So, remove it from the project for now.
I am trying to add a customized dialog box. For that I included a .jar file "annotations-6341fdfc066d3c9db92480c623dc4535". But when I am trying to run program it gives error like below
[2013-07-03 14:55:02 - TanetApp] Error generating final archive: Found duplicate file for APK: classes.dex
Origin 1: C:\Users\Rupesh\NewWrkplace\TanetApp\bin\classes.dex
Origin 2: C:\Users\Rupesh\NewWrkplace\TanetApp\libs\annotations-6341fdfc066d3c9db92480c623dc4535.jar
I also googled it but I am getting confused.
This might be a possibility
Classes.dex is also present in that annotations.jar file,but how to exclude classes.dex from .jar file ?