Unfortunately Google Maps API Demos has stopped - Google Maps Android API v2

╄→гoц情女王★ 提交于 2020-01-16 14:09:51

问题


I have a problem with Google Maps Android API v2. Every time I try to open the app on device or even on emulator this message always display

Unfortunately Google Maps API Demos has stopped

I have made a video that Explain every steps that I did

www.youtube.com/watch?v=WUmlu3CNOSo

Actually I have tried many tutorials on internet, also I tried to do the coding by myself according to Google's instructions and this is the error that display on Eclipse

www.ahmadssb.com/ttv2541/com.example.mapdemo.txt

Please advise.


回答1:


Simple answer:

Change your 'Order and Export' list ([project] Properties, Java Build Path) to the following order; src, gen, Android X.X.X, Android Dependencies, [any external libraries you may have]. Leave src and gen checked. Have a play around with checking or unchecking the others until it works.

Background:

I started getting these types of errors in the last month or so, so it may be to do with a new version of ADT or something. After much digging around I muddled through and found pieces of answers solving errors along the way.

The ClassDefNotFound error is because Eclipse is not exporting the libraries with your APK so when it comes to running on the device, they're not there. To fix this, make sure you check the correct things so that they are exported. Unfortunately, this step also trips me up so all I can say is have a little play with checking each in different combinations.

The next error I came across was something along the lines of Multiple Dex files. I'm guessing there was some conflict because I had Android Google APIs 4.2.2 and Android Dependencies checked. I assume there were two instances of a method or class that it didn't know which to use. Unchecking Android Dependencies solved it.

Hope this has been helpful, I've already wasted a day on this so hopefully it will save someone else that time!




回答2:


If you go to Properties -> Java Build Path -> Order and Export, is the 'android-support-v4.jar' checked?




回答3:


Me too,

but, I resolved it

code.google.com/apis/console/#project:xxxxxx > Service > Checking Google Play Android Developer API



来源:https://stackoverflow.com/questions/16178099/unfortunately-google-maps-api-demos-has-stopped-google-maps-android-api-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!