Eclipse help for brand new user - android

I am trying to create my first Android app. I am using Eclipse. I create a project, and before I add any code myself, I run the default project, and I get the 'Hello, MyApp' in my emulator.
All good.
I then drag and drop a button onto my 'avtivity', under the text that was added when I create the project.
Suddenly, XML errors!
[2012-06-02 18:03:48 - FuelLogger] res\layout\main.xml:0: error: Resource entry main is already defined.
[2012-06-02 18:03:48 - FuelLogger] res\layout\main.out.xml:0: Originally defined here.
[2012-06-02 18:03:48 - FuelLogger] D:\Android\eclipse\Workspace\res\layout\main.out.xml:1: error: Error parsing XML: no element found
[2012-06-02 18:03:49 - FuelLogger] Error in an XML file: aborting build.
It has created a new files, main.out.xml
What's that? It's empty.
My main.xml looks like this:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="#string/hello" />
<Button
android:id="#+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
If I look at the 'Graphical Layout' tab, it looks fine...
I am obviously missing something here. Hope someone can help.

I think you have selected your main.xml and is oped in code window;
then you r pressing RUN button of eclipse.
Which creates error.
First of All:
DELETE : main.out.xml
From your res\layout\ folder Then
To run project:
Make open "Project Explorer"
Rigth Click on Your Project,
Click Run AS
Click Android Application

Delete the main.xml.out file from your res/layout folder and the clean and build/run the application. If you are not able to delete the file from eclipse delete it from your workspace and the clean and build/run the application

Delete main.out.xml, and run as Android application after cleaning.
Here is detailed description
Similar problem answers: main-out-xml-parsing-error

also you might want to look here. Seems related to your question, that main.out.xml is what's causing the trouble...

Related

No resource identifier found for attribute 'ProgressIndeterminate in package 'cn.pedant.sweetalert'

I just watched a youtube video of setting a Stylish alert dialog in the project but the guy in the video was using Android Studio as development platform and i use Eclipse. So i just went to the mentioned GitHub link and downloaded the project library. Now i have imported that project library in my Eclipse. But inside one xml there is an error shown :
<com.pnikosis.materialishprogress.ProgressWheel
android:id="#+id/progressWheel"
android:layout_width="80dp"
android:layout_height="80dp"
wheel:progressIndeterminate="true"
android:layout_gravity="center" />
error: No resource identifier found for attribute 'ProgressIndeterminate in package 'cn.pedant.sweetalert'
error was in the first line of above code snippet.
Lol. That's funny how I accidentally got the solution for the above problem. I just needed to replace the
wheel:progressIndeterminate = "true"
to
wheel:matProg_progressIndeterminate = "true"
and it worked like a charm.

Met Strange situation In Exporting&Running Android project

I have got a strange situation when I working on my project.I have just run my application once. Then I changed some "android:margin" properties for my XML files. Then the problem came. I ran the project and it crashed. The log says it comes Resource Not Found Exception. Next I tried to export it but it failed to export. I'll post the log and error dialog below.
What have I done:
I reinstalled everything such as eclipse,ADT and SDK. Not work at all. I'm absolutely sure that the resource exists and stays in right position.**
All useful information is needed.
ps: The resource file that not found is an activity layout xml file--my intro activity and I've found the resource id in my R file.
ps: My friends use the same code as me.They don't have any problem.
here's my layout xml file:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/fl_base_activity"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_base_wallpaper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#color/trans_cc" />
</FrameLayout>
Try re-building your project , If that doesn't work , delete the 'build' and 'gen' folders of project(you can take a backup elsewhere but remove them from your project folder) and then try running it again.
Let me know if that works.....
I've found why : So stupid fail that there is a resource with no suffix has been add in my project from SVN. It has a same name with correct resource name but without .png, eclipse can't distinguish what's the difference between them. It has no error notice. WTF!

How can I use the Android library ExtendedCalendarView

I am new in Android-Programming and I and my programmer team have to program a little app for our college. So we need the ExtendedCalendarView-Library and we already imported it in our AndroidStudio-project but we always get the same failure:
Can not find the following classes com.tyczj.extendedcalendarview.ExtendedCalendarView
try to fix Build Path
and so on.
Code in our test.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<com.tyczj.extendedcalendarview.ExtendedCalendarView
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.tyczj.extendedcalendarview.ExtendedCalendarView>
</RelativeLayout>
But we have imported another library at the same way and it works. We also get a suggestion from com.tyczj.extendedcalendarview.ExtendedCalendarView when we open the '<' in a .xml file but always the same failure.
Meanwhile time is pressing so we have not so much time anymore.
Could anyone help us?
Have you copied the provider tag in your android manifest if not then copy it in application tag of AndroidManifest:
<application>
...
<provider
android:name="com.tyczj.extendedcalendarview.CalendarProvider"
android:authorities="com.tyczj.extendedcalendarview.calendarprovider" />
</application>

Couldn't resolve resource #drawable/homebackground

I created a new project in Android Lollipop (API 21) using Studio(64) and Java 7. When I try to add a background on main layout (relative layout) I am getting error
My res folder structure is
NOTE: I have placed 720x1280 img in all drawable* folders.
My XML is
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:padding="0dp"
android:background="#drawable/homebackground">
</RelativeLayout>
I tried using PNG / JPG.. but still I am getting same error. Can someone tell where am I going wrong ?
I referred these, but they are not related to my problem or don't solve my problem
Couldn't resolve resource #drawable/backround.png
RelativeLayout "Couldn't resolve resource..." Android
Android image can't convert to drawable
If you are using Android Studio, clicking on File > Invalidate caches/restart should solve the problem.
Inside the Manifest file .....in the field where there is #drawable/homeground replace that with #android:drawable/homeground
I tried "invalidate caches/restart" but it didn't work for me. So to solve this I moved my image(night_sky.jpg) from drawable to mipmap folder and the error was gone.
It worked for me hope it will work for you also 🙂
Image for reference:

Error parsing XML: no element found

First off forgive me if I posted this question wrong. I've used stackoverflow for many problems but this is the first time I couldnt already find an answer to my problem. So, if I'm doing something wrong please let me know and I'll repost / edit the question.
Now unto business. I've just recently started development w/ the Android SDK and I'm following the basic tutorial from http://developer.android.com/resources/tutorials/hello-world.html#avd
I've gotten up the xml editting part and when I make all the changes to the xml files main.xml and strings.xml this error occurs. Also, when I compile the project, the compilation process generates a main.out.xml file that is empty. I don't know what it is or its purpose.
The error:
[2011-12-30 16:10:02 - Hello Razor] res\layout\main.xml:0: error: Resource entry main is already defined.
[2011-12-30 16:10:02 - Hello Razor] res\layout\main.out.xml:0: Originally defined here.
[2011-12-30 16:10:02 - Hello Razor] C:\Users\Dux69\workspace\Hello Razor\res\layout\main.out.xml:1: error: Error parsing XML: no element found
[2011-12-30 16:10:13 - Hello Razor] Error in an XML file: aborting build.
My project is setup for platform: Android 2.3.3 API Level: 10
I don't know if it makes a difference or not but I'm using my Android Incredible for running/debugging the application not a Android Virtual Device. If there is any more information needed let me know and I'll post it ASAP.
Here are the three code files I'm using:
main.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/textview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:text="#string/hello_O" />
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hello_O">Baba in the house, Razor Activity!</string>
<string name="app_name">Hello Razor App</string>
</resources>
razorActivity.java
package hello.Razor;
import android.R;
import android.app.Activity;
import android.os.Bundle;
public class razorActivity extends Activity
{
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
I had a similar problem once.
Rebuilding/cleaning the project and restarting Eclipse helped for me.
delete the main.out.xml in project view and re-run as android application
Error message I got:
Error:(43) Error parsing XML: no element found
and
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Solution: In my case, project activity_main.xml is initiated with the code
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.batvibes.battybirthday.Main1Activity">
and I forgot the below end tag.
</android.support.constraint.ConstraintLayout>
Disclaimer: I am totally new to android development. My suggestion, please check all tags opening and closing and go to next step of debugging.
Try to end your Main or Sub Layout like:
</LinearLayout>

Categories

Resources