I'm developing application with Qt Creator. I just want use layout for specific Dialog.I created XML, but how to add this XML to project?
I added this xml on main_activity's directory (myApplication\android-source\res\layout)
but when I try to compile, I get this error after creating this:
BUILD FAILED
D:\1ADDDT\android-sdk2\android-sdk2\tools\ant\build.xml:716: The following error occurred while executing this line:
D:\1ADDDT\android-sdk2\android-sdk2\tools\ant\build.xml:730: Compile failed; see the compiler error output for details.
And I Should I add this XML to resource (.qrc) or what?
Here is my build.xml:
Use tools:context as one of attribute and set it to .MainActivity .
Related
I'm working with a Android App and XML.
By using Jaxb, I had java xml classes from a .xsd file.
I want to generate a xml file from these xml classes then validate against the .xsd file.
I found here an example:
http://www.mkyong.com/java/jaxb-hello-world-example/
But I cannot use javax.xml.bind.Marshaller:
Error:(76, 27) error: cannot access XMLEventWriter
class file for javax.xml.stream.XMLEventWriter not found
Then I add javax.xml.stream lib:
java.exe finished with non-zero exit value 1
I also posted a question about xml validation against xsd but till now I have not get any suggestion yet:
Android XML validation using XSD ( both xerces and SchemaFactory) error
Any suggestion for me?
Thanks,
Short answer:
XML Validation: xerces for android: https://code.google.com/p/xerces-for-android/source/checkout
XML Serialization: http://simple.sourceforge.net/
.xsd to java objects: Jaxb or Jibx
Is there a need in JAXB implementation for Android?
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
I'v just started building my first Android project with eclipse, according to Lynda's course Up and Running with PhoneGap.
When i try to run the project (like the demonstration on Lynda), i get the following error message:
"your project contains error(s), please fix them befor running your application."
Description Resource Path Location Type
error: Error: No resource found that matches the given name (at 'label' with value
'#string/app_name'). AndroidManifest.xml /android_project line 49
Android AAPT Problem error: Error: No resource found that matches the given name (at 'label'
with value '#string/app_name'). AndroidManifest.xml /android_project line 52 Android
AAPT Problem
The import org.apache.cordova cannot be resolved android_project.java
/android_project/src/com/example/android line 23 Java Problem
DroidGap cannot be resolved to a type android_project.java
/android_project/src/com/example/android line 25 Java Problem
The method onCreate(Bundle) of type android_project must override or implement a supertype
method android_project.java /android_project/src/com/example/android line 28 Java
Problem DroidGap cannot be resolved to a type android_project.java
android_project/src/com/example/android line 30 Java Problem
Config cannot be resolved android_project.java /android_project/src/com/example/android
line 32 Java Problem
Attached the error screenshot
I can guess what some of the error messages means, but i don't know how to solve them.
Any suggestion?
I'm using windows 8.
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Thanks,
Liron
Check your strings.xml inside your project>res>values and add the string values you are going to use in your project.
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<resources>
<string name="app_name">AppName</string>
</resources>
Plus, I think you need to update your .jar file of cordova.
You can download it from the phonegap github repo.
You can find the lib in the lib/android/ folder.
To create a new project, you can use the lilb/andoird/bin/create.bat file.
Don't forget to clean the project.
Hope this helps you.
I think You forgot to set the string values. I havenĀ“t read that tutorial, but there are some strings missin. Check the tutorial, You have to set some strings inside strings.xml in Your res/values folder
EDIT
go to folder inside Your project "res/values" and open strings.xml. Then begin a new line and put
<string name="example_string">This is an example!</string>
The first part "example_string" is the name of the string. This is to refer to this for example inside an xml layout. imagine You have a button in any xml layout:
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/example_button"
android:text="#string/example_string"/> <-- here you refer to that string inside strings.xml
The second part "This is an example" is what will be appear on that button.
But I think it would be better if You learn the basics instead of starting with PhoneGap.
http://developer.android.com/training/basics/firstapp/index.html
Updated to the latest Android Build tools (0.4.2) and ran into the following when attempting to assemble:
/AndroidApp/App/build/res/all/flavor/debug/layout/fragment.xml:84:
error: No resource identifier found for attribute 'gapWidth' in package 'com.viewpagerindicator'
RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/build/res/com.viewpagerindicator"
android:layout_width="match_parent"
android:layout_height="match_parent" >
Since flavors may use a different packagename, instead of specifying the package name in the custom namespace, use: 'http://schemas.android.com/apk/res-auto'.
Update your custom XML link paths to use build instead of apk.
Was, in the fragment.xml file
xmlns:app="http://schemas.android.com/apk/res/com.viewpagerindicator"
Now, to this:
xmlns:app="http://schemas.android.com/build/res/com.viewpagerindicator"