Package com.google.android.maps does not exist (IntelliJ)
I've used the Maps APIs many times befo开发者_Python百科re and not had this problem, but I've clearly done something wrong with this IntelliJ project. Under Settings->SDKs I have specified the platform 7 Google API in the classpath - it still fails to build saying the Maps APIs are not there. I have also tried added a separate reference to the classpath to the Google APIs .jar, but still the same problem.
How do I fix my IntelliJ IDE project so it correctly builds against the Google APIs?
It's been a long day, I am probably missing something obvious.
So to get the Google (Maps etc) APIs working in IntelliJ:
- Under File->Project Structure->SDKs add an item for the platform level you're targetted. Under the classpath tab add a reference to the top of the android SDKs folder, and use the Build Target menu to specify which platform to target.
- Under Settings->Project Structure->Modules->Dependencies select the SDK version from the "Module SDK" list
- If you need to target the Google (Maps etc) APIs then under Settings->Project Structure->SDKs->Classpath make sure you ALSO add a reference the .jar file for the Google APIs for that platform version (e.g. addons/addon_google_apis_google_inc_8/libs/maps.jar
Under my version of Idea, the controls are a bit different:
Project settings -- Modules -- (ModuleName) -- triangle to unfold the tree -- Android; and on the right you see "Android platform:" and a selection control. There is no "Android 2.1-update1 Google APIs" in that control, but you press the "New" button and... select an existing directory with downloaded stuff, e.g. /android-sdk-mac_x86/platforms/android-9
I still don't understand why it reads "New", but it works.
I use the newest 0.8.9 version and I must say there is no File->Settings option and the preferences reached by clicking the tool icon have no Modules section inside. How do I fix my problems with import com.google.android.gcm.GCMRegistrar; not found?
精彩评论