Upgrading to Gradle 7.1.1 in Android Studio Breaks Build - android

After upgrading to Gradle 7.1.1, I get the following build error:
Unexpected EOF in prolog
at [row,col {unknown-source}]: [1,0]
I've done as many Google searches as I could but can't find anything on this. I've tried running the build with stacktrace, debug and scan options but there is nothing in the output window that gives a hint as to where this is coming from, except that it's in this task:
app:mergeProductionDebugResources FAILED
I'm assuming there is some file somewhere that's doing this but I don't know how to begin finding it.
I would like to know if there is some place to look that I'm not aware of, or if there is some procedure to help me track this down.

I found my issue. Someone had added an empty xml file to the project. Previous versions of gradle just ignored this, but 7.1.1 doesn't.

Related

PayCards Android Dependencies Errors | Could not resolve all task dependencies for configuration

I recently migrated to Android Studio 4.0 and made the decision to update all dependencies, including Gradle.
When I tried to compile the app, this error [the image below] is shown.
This type of error usually happens when libraries are updated, so I decided to go back to a previous commit where I didn't make any modifications but I was surprised that the error was still there.
I proceeded to check some similar errors on the network and made several changes with my gradle and dependencies .. even i went back to the previous version of Android 3.5 but the error persists.
I don't understand what the error might be. This image shows the versions of Gradle that I am using and the error that is displayed, I think it has to do with POM parser.
[Fatal Error ]Getting root element must be well-formed. error in android build
Does anyone knows what might be wrong?
There is also an error with some libraries i am using (for example: paycards).
https://github.com/faceterteam/PayCards_Android
the error shown is:
The markup in the document following the root element must be well-formed (but its in spanish... why???)
Today is 4 jun 2020 and i've made some research. there is actually some people with this error so i found a temporal solution an the Github 'Open Issues' segment of the PayCards library.
This issue was opened 3 days ago so i think its a new issue with the library.
https://github.com/faceterteam/PayCards_Android/issues/49

Android Studio Execution failed for task ':app:mergeDebugResources' with special chars in username

i have a strange error with AAPT2 iin Android Studio. I think it has something to do with german special characters in my account name in windows.
If i set my gradle to version 3.0.1 and also set android.enableAapt2 to false everything works fine. But since i researched, setting the option is not a solution to the problem.
Now if i set the gradle version to 3.1.2 and remove android.enableAapt2 from the properties i get the following error message:
And this one:
One way to solve the problem was to create a new account in windows without special chars in the name. It compiled and did run very well. I really tried everything in the web but could not find a solution to the problem.
Maybe you can help me.
First of all check your build log botom of the build section you shared whether any error related to your project showing or not. If error showing then fix those. Build and run again and fix all the error comes up. It will eliminate aapt2 issue without changing android gradle plugin.
Secondly if there is not any project related error showing in the build log but still its showing aapt2 error then you can fix it by following below steps.
Update your android gradle plugin in your project level build.gradle file like below:
classpath 'com.android.tools.build:gradle:3.2.0-alpha13'
Now update android.enableAapt2=true. Then check and build your project.

Android - Deprecated NDK warnings in Android Studio

After a long time working fine my project suddenly build failed. The image below is what i get from log.
I already have gradle.properties file with 'android.useDeprecatedNdk=true' in my project but the error keep show up.
Please help. :(
The warning says that useDeprecatedNdk=true will stop working soon. If you plan to keep using the latest Gradle Plugin, you should edit your build.gradle and use externalNativeBuild.
Actually, the change should be pretty easy, and the explanation on developer.android.com is quite straightforward.
The error you see is probably not related to the warning. Something went wrong in your build. The easiest way to find out is to run same ndk-build in the terminal window of your Android Studio, and analyze the results.
Carefully copy all parameters from the log, and add V=1:
/Users/haulx94/Library/Android/sdk/ndk-bundle/ndk-build NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/Android.mk APP_PLATFORM=android-25 NDK_OUT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/obj NDK_LIBS_OUT=/Users/haulx94/AndroidProject/hd1-android/HDONE/app/build/intermediates/ndk/stagging/debug/lib APP_STL=gnustl_shared APP_ABI=armeabi-v7a V=1

Seeing errors in Android Studio 2.1.2

I'm an Android Studio noob and I'm confused about how it reports errors. I have a fairly large Android project - about 25 java source files - mostly Activities - and a similar number of XML files.
I do a Build > Clean Project and a Build > Rebuild Project, and the Gradle Console reports BUILD SUCCESSFUL. In the Messages tab it says:
BUILD SUCCESSFUL
Total Time 4.368 seconds
0 errors
0 warnings
But if I actually open up an XML file, e.g., the Android manifest.xml file, I see errors marked in red, such as
Cannot resolve symbol 'PlyListActivity'
and
Cannot resolve symbol 'ActivityMsgClass'
... those seem like errors to me. Yet the Android manifest.xml file is not marked or highlighted in any way in the UI - if I hadn't opened it in the editor I wouldn't have seen those errors. So short of opening up each of the 25 XML files in my project, how can I find out about such errors when I do a build?
Edit: Just to be clear - my question is not about what causes the errors listed in the manifest. My question is why does the build show 0 errors and 0 warnings, and is there any way in Android Studio to be aware of these errors/warnings short of having to open up each and every file (25 in my case) in the editor to look for them?
This is a very annoying bug, and it's been around forever. Unfortunanetly, there is no way you can fix it, this doesn't only happen to the Manifest but to the resources XML files too. However, your app will crash if there is a real error, not a warning.
However, there could be a way if you mess around Android Studio, I couldn't find this, but maybe you could:
Go to Android Studio. Go to File>Settings, alternatively press CTRL+ALT+S
Go to Editor>Inspections,now here, you can change all the errors in Android Studio to a warning, or nothing and vise-versa. This could solve your problem if you find your error in this window and disable it (Make sure it is Manifest Only). Otherwise, I hate to say the answer even for myself, there is no solution.
UPDATE: If you go to Analyze>Inspect Code you can see all your errors and warnings in your project.
This is not an error. This show both the class are not defined in your project as activity, but you have still defined in manifest as activity.
If you run the 'lint' gradle task, it should generate an webpage that details all the warning/error/issues it detects during build time.
Ran lint on variant debug: 11 issues found
Ran lint on variant release: 11 issues found
Wrote HTML report to file:///C:/Android/JsoupExample/app/build/outputs/lint-results-debug.html
Wrote XML report to file:///C:/Android/JsoupExample/app/build/outputs/lint-results-debug.xml

Android studio How to resolve Error in png files of library added

I have no Idea what is happening, last time when I finished my app I build its release apk and all was working just fine as expected but now today when I tried to make that pproject again and to make another apk I am getting the following error.
Error:Execution failed for task ':app:mergeDebugResources'.
Crunching Cruncher common_signin_btn_icon_pressed_light.9.png failed, see logs
I have no idea how to resolve it I have serached and found restarting Android studio and clean the project would remove it , doing this many times has no effect on this error. I have even restarted my machine but the condition of error in same.
In the logs I have seen that this png file is from the library I added , so just for testing I removed that library and tried to build then it started to give me same error with different png file name in other library. So how to fix this issue ?
My Questions are :
How can this issue be Solved ?
Have some one faced this problem too ?
Is this problem has been reported to google ?
Why in android we do not have any stable platform for development as IOS have ?
Try to remove "builds" folders and do rebuild. But soon, the whole thing in a long file name. Read this answer. By the way, you looked logs? Maybe this is not the PNG? You have not sent the log and did not specify the version Gradle.
Believe me, iOS developers have own problems.

Categories

Resources