Question

I am starting to honestly think Eclipse does not want me to finish my project...

Firstly it stops updating my xml files for some reason. Soooo, I decide to clean my project, which makes my R.java file simply disappear. Why in the world did this happen and how can I get it back?

Also, why is aren't my .xml layout files not updating?

Here is the code of the xml file I was working on. It has no indication of an error and I don't see where this error courld be.

 <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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.jfitnessfunctiontester.RegisterUserActivity$PlaceholderFragment" >


<TextView
    android:id="@+id/ageRegisterTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="32dp"
    android:layout_marginTop="41dp"
    android:text="Age:" />

<TextView
    android:id="@+id/weightRegisterTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/ageRegisterTextView"
    android:layout_below="@+id/ageRegisterTextView"
    android:layout_marginTop="52dp"
    android:text="Weight (kg):" />

<TextView
    android:id="@+id/heightRegisterTextView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignLeft="@+id/weightRegisterTextView"
    android:layout_below="@+id/weightRegisterTextView"
    android:layout_marginTop="48dp"
    android:text="Height (cm):" />

<EditText
    android:id="@+id/ageRegisterEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/ageRegisterTextView"
    android:layout_alignBottom="@+id/ageRegisterTextView"
    android:layout_marginLeft="14dp"
    android:layout_toRightOf="@+id/ageRegisterTextView"
    android:ems="3"
    android:inputType="number"
    android:maxLength="3" >

    <requestFocus />
</EditText>

<EditText
    android:id="@+id/weightRegisterEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/heightRegisterTextView"
    android:layout_toRightOf="@+id/heightRegisterTextView"
    android:ems="3"
    android:inputType="numberDecimal"
    android:maxLength="3" />

<EditText
    android:id="@+id/heightRegisterEditText"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignBaseline="@+id/heightRegisterTextView"
    android:layout_alignBottom="@+id/heightRegisterTextView"
    android:layout_alignLeft="@+id/weightRegisterEditText"
    android:layout_marginLeft="14dp"
    android:ems="3"
    android:inputType="number"
    android:maxLength="3" />

<Button
    android:id="@+id/finishRegisterButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignRight="@+id/weightRegisterEditText"
    android:layout_below="@+id/sexRegisterSpinner"
    android:layout_marginTop="68dp"
    android:text="Finish" />

<Spinner
    android:id="@+id/sexRegisterSpinner"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/heightRegisterEditText"
    android:layout_marginTop="38dp" />

Thanks

Update: I copied and pasted my old R.java code since I couldn't figure out how to get the new one (Is that ok to do?) And now my program won't even compile saying there are mistakes. The thing is, there are no indications of errors at all!

Update 2: Here are the errors I ended find through the Eclipse problem view: Description Resource Path Location Type Error generating final archive: java.io.FileNotFoundException:

C:\Users\Julia\git\FuzzFit\FuzzFit\bin\resources.ap_ does not exist FuzzFit Unknown Android Packaging Problem Unparsed aapt error(s)! Check the console for output. FuzzFit Unknown Android Packaging Problem

Update 3: I have up trying to do all this stuff when nothing is working, so reverted to the version I committed yesterday. Surprise surprise I have a whole new set of errors! Apparently one of my Activities is not finding it's layout files. The error messages are that it doesn't exist. But it does!! I am starting to lose my mind here! What I mistake it was to open this project today... What a mistake...

Was it helpful?

Solution

Alright folks! Figured it out!

Turns out it has everything to do with Eclipse's updates, in which in generates the activity a different way than it used to. Instead of generating it with just the layout it also has the fragment layout thing which I still have no idea what it does. Using another users question, I did what other user's told me and got rid of the fragment file and made minor changes on the activity class file.

This worked like a charm yesterday, or so I thought... Until today I decided to change some things and they wouldn't change anymore. The error was in the menu files which are also generated, I just had to delete a couple of lines which made no more sense now. That was it!

Uhh... Now just to get something off my chest: I HATE HATE HATE HATE this update so far it has given me nothing but problems!

Thanks for all your help everyone!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top