MrGibbage
MrGibbage

Reputation: 2646

How do I open this Android project in Eclipse?

https://github.com/android/platform_packages_apps_alarmclock

I have it cloned on my PC, and I tried to create a new project from existing source. I pointed it to the code I downloaded, but I had bunches of errors. I went into the project properties, and set the build target to Google API (8), and that fixed a lot of the errors, but I can't fix the remaining errors. This is my first time importing a project from github into Eclipse, so I am probably missing some simple fundamental steps.

Edit: adding error listing I am down to 9 errors (some are dupes)

ACTION_ALARM_CHANGED cannot be resolved or is not a field in Alarms.java

Cannot instantiate the type Vibrator in AlarmKlaxon.java

com.android.internal.R cannot be resolved to a variable in AlarmKlaxon.java and SetAlarm.java

mContext cannot be resolved in DigitalClock.java (x5)

Upvotes: 0

Views: 384

Answers (2)

abbath
abbath

Reputation: 2482

Somewhy in the project.properties the target was android-3 (target=android-3), write it to target=android-8, because a lot of layout xmls are using match parent. Then clean the project (Eclipse->Project->Clean...) After this, no more xml errors will be there, but some java code errors remain, which are from use of com.android.internal.R which is a hidden android api? This explains the use of it: http://devmaze.wordpress.com/2011/01/19/using-com-android-internal-part-5-summary-and-example/

Upvotes: 1

Phil
Phil

Reputation: 36289

File -> import... -> existing projects into workspace -> select project

Upvotes: 1

Related Questions