IT Staff

Blog về chuyên ngành IT

[Android] Begin of the Beginning

leave a comment »

After an importing a previously working package into my Eclipse IDE All of my packages started producing errors specifically about not being able to find the native library directory that contained the “ANDROID_FRAMEWORK”. After some tinkering I decided that the best thing would be to start again and do a clean install of the IDE. I followed Google’s instructions for installation

Using the latest Helios version of Eclipse. I created a new directory and workspace, linking to none of the resources from my old IDE in fact I trashed all of it before reinstalling.

I created a new “hello world” project to test the install. Upon creation the new package threw the following error.

“Unable to read /Developer_Android/Android-sdk/AndroidManifest.xml: /Developer_Android/Android-sdk/AndroidManifest.xml (No such file or directory)”

Now this is what I was encountering before as well. This being a new install though I do not know what could be causing this. Unless there is some resource OUTSIDE the eclipse folder that is setting a preference that I inadvertently changed and remains intact after my deletion of the previous IDE.

Any Clarity anyone can lend to this situation would be helpful since all dev work is FULL STOP.

right-click project -> android tools -> fix project properties

This error occurs in setContentView line in this code snippet:

/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.main); 

I understand that in order for R.layout.main to be resolved, a file named res/layout/main.xml must be present.

It is present and valid (i.e. Eclipse marks it as perfect without any errors). So, what else could cause this error?

BTW, I already tried Project > Clean. The error persists.


Make sure you don’t have this in your imports:

import android.R; 


import your.application.packagename.R; 

I keep getting this error… should I just make “id” a field? My code:

public void onCreate(Bundle icicle) {        super.onCreate(icicle);        setContentView(R.layout.main);      ImageView mainimage = (ImageView) findViewById(;      mainimage.setBackgroundResource(R.anim.mainanim);      mainanimation = (AnimationDrawable) mainimage.getBackground(); 

How exactly do you fix this?

Do not modify the R class. The error means there’s something syntactically wrong with your XML layouts and R cannot be auto-generated. Try looking there and post the xml code you’re not sure about, if any.


Written by Xavier

Tháng Tư 28, 2012 lúc 7:19 chiều

Posted in Android

Tagged with

Trả lời

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập: Logo

Bạn đang bình luận bằng tài khoản Đăng xuất /  Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Đăng xuất /  Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Đăng xuất /  Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Đăng xuất /  Thay đổi )


Connecting to %s

%d bloggers like this: