I downloaded an android project and opened it in eclipse. eclipse can not resolve R in "setContentView(R.layout.ayat)" so I guess I may have problem in "res" folder and yes!! one of my xml files in "res" folder has a big red X with "Error parsing XML: not well-formed (invalid token)" message.
I know that It means there is a compilation error in my XML file, something that shouldn't be there: a spelling mistake/a spurious character/an incorrect namespace.error but unfortunately i cant find the bad typed command.
this is the XML file:
The <resources> tag, and in your case the <string-array> tags, doesn't accept xmln attributes, such android:layout_width or android:layout_height. Getting rid of them will fix your issue.
Related
enter image description hereResource compilation failed (Failed to compile values resource file E:\AndroidStudioProjects\AuthenticApp2\app\build\intermediates\incremental\debug\mergeDebugResources\merged.dir\values\values.xml. Cause: java.lang.IllegalStateException: Can not extract resource from com.android.aaptcompiler.ParsedResource#4510599a.). Check logs for more details
Find and exchange all ' symbols in your strings.xml or somewhere else in your code with \'
Look into the resources in ids.xml file and comment out each id one by one and try to simulate the emulator. I also had this problem but when I removed the EditText id from the resources of ids.xml, then the issue was resolved.
I can't get my Android project to build any more. The first error comes up in a file located at PATH_TO_PROJECT/app/build/intermediates/res/merged/debug/values/values.xml and the error reads Error:(2251, 58) String types not allowed (at 'android:id' with value ''). That line is
<style name="Platform.ThemeOverlay.AppCompat" parent=""/>
But in the file, the line that has red text indicating an error is the first line after the <?ml line
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
with the part in quotes being red.
I also have a problem with my classes suddenly showing errors using R.id or R.menu or R.whatever, though I'm sure that's something that is a side result of the above issue.
I thought it might be that gradle was updated, but I haven't made any changes to the gradle app file, just updated from 2.2.0 to 2.2.2, would that have caused it?
I have 2 problem that I think both of them is for one reason:
When I try to add a new XML layout; that XML fail add successfully but in "Console" show me it:
[2014-05-04 18:41:11 - Example] W/ResourceType( 5804): ResXMLTree_node size 0 is smaller than header size 0x14.
[2014-05-04 18:41:11 - Example] D:\Android\Workspace\Example\res\menu\main.xml:4: error: Error: Resource id cannot be an empty string (at 'actionLayout' with value '#android:layout/').
and I can get resource to it in classes.
In "problem" tab:
Errors: Unparsed aapt error(s)! Check the console for output.
Location: line 1
Type: Android ADT Problem
and I cant solve it
Please same one help me ...
I sorted this out. So for anyone else still on the learning curve with me, the solultion is as noted in my comment. In addition -
aapt = Android Asset Packaging Tool From the Developers Guide - "The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML files for your Activities, and compiles them."
The solution for me was simply to delete the error on the 'Problem' window (right click | delete). Then, force a rebuild by rerunning the app. Any remaining problems will now show up and be logged so you can track them down.
Hope this is helpful to others.
I'm getting the error executing aapt :return code 1073741819 due to which
.apk file is not generated how to fix this. How to fix if r.java file is missing
It could be a syntax or formatting error in one of the XML files. I just got this error code (it's actually negative), and I checked all the #string references and they were OK. Eventually I figured out it was because of this item in a menu XML file:
<item
android:id="#+id/action_stop"
android:orderInCategory="100"
android:icon="#drawable/ic_action_stop"
android:showAsAction="ifRoom | withText"
android:title="#string/action_stop"/>
However, the spaces around the | apparently aren't valid (XML isn't Java...). Eclipse didn't catch it as an error, but aapt crashed without giving a reason when it saw it. Not particularly graceful handling, by both Eclipse and aapt. Removing the extra spaces made everything work.
The problem with missing entries in strings.xml apparently produces error code -1073741816, not -1073741819. You have to look closely, but the last digit is different.
I'm not saying the problem is definitely some sort of syntax error. But it's another possibility that could be investigated.
I got this error when I had deleted a #string entry that was being referenced in a menu node xml resource.
I had this error and spent time trying to find a solution.
Finally the solution for this error which is: -1073741819 ( check the digits ) was a library was missing from: Properties -> Android -> Library
I just added the missing libraries and got this error resolved.
I got the same problem. What helped me was changing the Project Build Target
Properties->Android->Project Build Target
Well I have a single language android application that I translated strings in res/values/strings.xml to make it multi language application. I made for instance values-fr/strings.xml, values-es/strings.xml ...
When compiling my application, I get this error
mayapp/res/values-fr/strings.xml:1: error: Error parsing XML: XML declaration not well-formed
mayapp/res/values-es/strings.xml:1: error: Error parsing XML: XML declaration not well-formed
How to solve this problem.
I need your help since I'am new in android development.
use numerical code for special character:
<string name="app_name">Répondeur</string>