Eclipse to Android Studio importing error - android

While importing a project I got the following error :
AAPT err(Facade for 3882930): libpng error: Read Error
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ProjectName:mergeDebugResources'.
> Some file crunching failed, see logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
I tried to clean, rebuild and also restart studio as well as my PC but no luck. Can anyone help me?

Finally i got an answer,
I took all the images an pasted them on https://tinypng.com/ and downloaded the optimized images. put them in their respective positions and Voila the error was gone.
I guess the images had corrupted as it was a 1 year old project which i was trying to import.

Related

Error occurs after I have uploaded icons for app (in Android Studio with Flutter)

I have created app icons with a website called appicon. It provided icon files for both android(mipmap files) and ios devices(an Assets.xcassets file), which I added to their respective locations being (C:\Users\user\StudioProjects\i_am_rich(name of app)\android\app\src\main\res) for android and (C:\Users\user\StudioProjects\i_am_rich\ios\Runner) for ios.
When I run the program the following error is displayed:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\user\StudioProjects\i_am_rich\build\app\intermediates\packaged_manifests\debug\AndroidManifest.xml:16: AAPT: error: resource mipmap/ic_launcher (aka com.example.i_am_rich:mipmap/ic_launcher) not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 36s
Exception: Gradle task assembleDebug failed with exit code 1
I am learning Android Studio as the IDE with flutter, as a beginner, so I don't understand the problem nor what I have to do to fix it.
Help and, possibly, an explanation would be greatly appreciated :)
The website you mentioned does generate correct names and correct order of directories it seems. so most probably this is an issue with where you have put your files or the name of the files.
The 5 directories of icons must be copied to android\app\src\main\res folder.
and make sure in each directory you have a file called ic_launcher
if all is correct, please run flutter clean command and try again.
also by anychance the webisite generating incorrect files, try using this web site AndroidAssetStudio

Build failed 'A problem occurred configuring project ':react-native-reanimated'. in React native project

I am trying to run project with command,
npx react-native run-android
and found this as an error:
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\Documents\project\project_Workspace\projectname\node_modules\react-native-reanimated\android\build.gradle' line: 69
What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 33s
stuck to resolve this error.
Help me to resolve this error.
this problem happened in windows because of slashes
in your project folder navigate to android and open local.properties file
replace
sdk.dir=C:\Users\\<userName>\AppData\Local\Android\Sdk
with
sdk.dir=C:\\Users\\<userName>\\AppData\\Local\\Android\\Sdk
and it will work correctly
Try to use this version
"react-native-reanimated": "2.0.0-rc.3"
It's worked to me.
For me, updating to reanimated#2.11.0 fixed my compile error
I am using react-native 0.69.3.
As mention earlier this work
sdk.dir=C:\\Users\\<userName>\\AppData\\Local\\Android\\Sdk

Build failed: directory does not exist

Had a working project on a PC.
After transfering project on other PC (with installing Studio from scratch), unable to build the project now. Getting:
Error:FAILURE: Build failed with an exception.
What went wrong: A problem was found with the configuration of task ':app:dataBindingExportBuildInfoDebug'.
Directory 'Z:\path_to_proj\app\build\intermediates\data-binding-info\debug'
specified for property 'xmlOutFolder' does not exist.
Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED in 1s
Any clues where to dig?

Android Studio R Cannot be Resolved - Error on Clean and Gradle Build

I am currently working on an app for my own personal use but have 1000001 problems with Android Studio - now R cannot be resolved - and cleaning gives the result below:
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
Error: Failed to run command:
C:\Users\William\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe s -i C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\drawable-xhdpi\abc_textfield_search_activated_mtrl_alpha.9.png -o C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\res\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png
Error Code:
42
Output:
C:\Users\William\Dropbox\111 WORKSPACES 111\Android Studio\Legacy\Notifications Alarm\2015-03-24 AndroidStudioProject\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\drawable-xhdpi\abc_textfield_search_activated_mtrl_alpha.9.png ERROR: Unable to open PNG file
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 17.777 secs
Above is the error message I keep on receiving when I clean my project. I can't find any XML errors, I have no foreign bodies in my resources except the launcher picture, and I can't find my R file anywhere - let alone reference it without error. The above error points to a
abc_textfield_search_activated_mtrl_alpha.9.png
That I have found and deleted - I don't think this is the right solution as the error persists. I have update Android Studio synched the Gradle and everything I have seen from my research. I really don't know how to handle this.
Thank you.

My first android program build fails. Error: The system cannot find the path specified

The error messages copied from android studio are as follows:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException:
Failed to run command:
E:\Android\android-studio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4
--output F:\AndroidStudioProjects\GeoQuiz\app\build\intermediates\dex\debug
F:\AndroidStudioProjects\GeoQuiz\app\build\intermediates\classes\debug
F:\AndroidStudioProjects\GeoQuiz\app\build\intermediates\dependency-cache\debug
Error Code:
1
Output:
The system cannot find the path specified.
Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
I previously used the eclipse IDE, appeared the same error message, which is "The system cannot find the path specified".
And I searched nearly all the similar question from the web, the problem not solved yet.
The IDE internally use some .bat file to find the java.exe location, but my .bat file not function for some reason unknown.
So I suspect the problem comes from my another problem:
My bat file can't run correctly, why?

Categories

Resources