简体   繁体   中英

Error Deploying an Android App Using Google Maps API

I'm attempting to run an Android app, that makes use of Google's map API, onto the Android simulator via the Eclipse plugin.

Even though I have the Google APIs installed, when I created my initial project, the links to the API jars where not included. So I copied maps.jar from android-sdk-linux/add-ons/addon-google_apis-google-16/libs into my project's libs folder, and that resolved all the reference errors.

However, when I go to "Run" (Ctrl+F11) my app on the simulator, it fails with the error Package com.mydomain.myapp requires unavailable shared library com.google.android.maps; failing! Package com.mydomain.myapp requires unavailable shared library com.google.android.maps; failing!

I have several other jars in my libs folder, and I'm not getting any errors for those. Why isn't it copying over the maps.jar? How do I resolve this error?

按照Yawus的说明进行操作,然后执行以下操作:单击AVD Manager,然后突出显示您的虚拟设备并单击Edit,然后将Target更改为Google APIs (Google Inc.) - API Level XX

Are you targeting the Google APIs when you create your project? Try this:

  1. Right-click your project in the Package Explorer
  2. Click on "Properties".
  3. Click on the "Android" tab
  4. Check the appropriate "Google API"
  5. Apply changes and see if it works.

You need to create a simulator that has the google libraries in it. You can't add it to your app. If you look, when you created the virtual device you can either pick versions that have or don;t have Google APIs in them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM