gpt4 book ai didi

android - 谷歌地图 API v2 不工作

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:06:00 25 4
gpt4 key购买 nike

我正在尝试运行此处提及的示例代码:Google Maps Android API V2 Sample code

但我收到错误 NoClassDefFound。下面是我的日志。

谁能帮我解决一下。任何帮助都是高度适用的谢谢

12-04 18:04:18.854: E/AndroidRuntime(1801): java.lang.ExceptionInInitializerError
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstanceImpl(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstance(Class.java:1319)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.os.Looper.loop(Looper.java:137)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-04 18:04:18.854: E/AndroidRuntime(1801): at dalvik.system.NativeStart.main(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:98)
12-04 18:04:18.854: E/AndroidRuntime(1801): ... 15 more

最佳答案

我遇到了同样的问题,并通过执行以下操作得到了解决,

  • 删除您手动添加的 android-support-v4.jar
  • 右键单击项目并选择 Android Tools -> Add Support Library ...

在此之后一切都对我有用。

关于android - 谷歌地图 API v2 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13703273/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com