javax.microedition.lcdui
is not part of the Android SDK
Import javax.* cannot be resolved
-
08-07-2023 - |
Question
OK so I finally decided to post my hard time here for help after two days of Googling and frustrating myself.
I am trying to build a simple android app. I am using latest version of Eclipse Kepler and running Mac OS X (Mavericks). I have the latest JRE 8 (updated 05). I have downloaded and installed the ADT Plugin. I have set the location to the Android SDK in Eclipse. The SDK Manager and AVD Manager are all set and OK. On creating a new Android project, at the point where there's the Blank Activity screen, I click finish and the Blank Activity Screen won't vanish (I don't know why :( ). I close it then and copy all my java classes into the src
of the project but get dozens of errors that go like The import javax.microedition.lcdui cannot be resolved
.
I have done the process several times trying different options and checking if this thread would help: import android packages cannot be resolved but it didn't. At this point I am stuck and out of ideas and would appreciate some help here. This is how my IDE looks like currently:
Solution
OTHER TIPS
You are using Java MicroEdition (Java ME) API
instead of Android
, while it is not valid. J2ME and Android have totally different SDK.
Please, follow the description from the Android Developer main page:
http://developer.android.com/sdk/index.html
If you really want to use J2ME MIDP jars on Android (it is not recommended, but it's your will), please, see this thread:
Package javax.microedition.lcdui is part of Java ME.