com.android.builder.internal.aapt.AaptException: Failed to crunch file - android

Building the project throws the following
error:
Error:com.android.builder.internal.aapt.AaptException:
Failed to crunch file ....\common_google_signin_btn_text_dark_pressed.9.png into ....\common_google_signin_btn_text_dark_pressed.9.png

Error: File path too long on windows, keep below 240 characters
Just try to use shorter path for your project. In my case i have just moved my project folder to desktop and after opening project from desktop this problem will disappear automatically.

Related

Getting Error: File 'ic_launcher.png' uses reserved file or directory name 'res'. while building Bundle file Android Studio

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.

Android resource linking failed on build APK

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

Android development

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.

Phonegap : 9patch image malformed

I am trying to run a Phonegap application but some images in the resources directory are preventing it from starting. when i delete the images files from my project it works just fine.
Execution failed for task ':mergeDebugResources'.
Error: Failed to run command:
/Users/macbookpro/Library/Android/sdk/build-tools/22.0.1/aapt s -i ../platforms/android/res/drawable-land-xhdpi/screen.9.png -o ../platforms/android/build/intermediates/res/debug/drawable-land-xhdpi-v4/screen.9.png
Output: ERROR: 9-patch image ../platforms/android/res/drawable-land-xhdpi/screen.9.png malformed.
No marked region found along edge.
Found along top edge.
First remove all your splash.png files and clean your cordova project by using this command ./platforms/android/cordova/clean
then copy the splash.9.png files in your res folders
then build the project, that worked for me.
You can make .9.png files with the help of this online tool

Build android application for release using ant in eclipse

When signing and building my application for release through ant in eclipse I am getting an error.
I am using the ant task that comes with the android sdk.
Keystore file, alias, pass are defined in ant.properties.
BUILD FAILED
C:\Program Files
(x86)\Android\android-sdk-windows\tools\ant\build.xml:981: The
following error occurred while executing this line:
C:\Program Files
(x86)\Android\android-sdk-windows\tools\ant\build.xml:995: Execute
failed: java.io.IOException: Cannot run program "jarsigner.exe" (in
directory "C:\dev\projects\sample1"): CreateProcess error=2, The
system cannot find the file specified
Followed instructions here: http://developer.android.com/guide/developing/building/building-cmdline.html
You need to have the folder YOUR_JDK\bin in your path
(YOUR_JDK being the folder where you have installed the Java JDK)
It's looking for the Jar signer in the wrong location.
Might be worth checking your path environment variable is set up correctly (so that it can find jarsigner.exe)

Categories

Resources