Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to run imported project

I have a few projects that were previously tested to be working in 1 PC.

I've since moved to another Windows XP PC, and I've setup the development tools on this XP system. I've downloaded and installed the following in order:
1. Eclipse Classic 3.6.1
2. JDK v6(jdk-6u23-windows-i586.exe)
3. Android SDK Tools rev8(installer_r08-windows.exe)
4. SDK Platform v2.3/2.2, Google APIs, Android API8, rev2, Google USB driver, rev4
5. ADT 8.0.1

I created a new empty project just to make sure things are working, and I seem to be able to get that new project to run on the emulator just fine. However, when I imported an existing project into the workspace, I get a bunch of errors, such as: "The import java.util cannot be resolved" "The import android cannot be resolved"

When I look at Project Properties->Java Build Path, it shows "Unable to get system library for the project" under "Libraries" and "Order and Export". What's wrong?

I've also tried copying and pasting the .java files and main.xml files from the imported project to the new project, and it runs correctly...but somehow the imported project doesn't.

Thanks.

like image 520
Goi Avatar asked Dec 21 '10 07:12

Goi


1 Answers

  1. Right click on project name, open properties.
  2. Select Java Build Path (from left menus)
  3. Under the "Libraries" tab, find the entry 'Unable to get system library for project', select it then click on the Remove button.
  4. Select Android (from left menus), tick on the version of android you want to target.
  5. Select Project menu (main top level menu), select Clean... Select OK.
  6. Right click on project name again, go down to Android Tools > Fix Project Properties.

That should do the trick and add Android X.X (version you selected) to your project, and the imported project should start working.

Enjoy.

like image 125
MindWire Avatar answered Oct 12 '22 11:10

MindWire