问候! 提前感谢您查看我的问题。我想在模拟器(Eclipse)中运行Google Map,但每次运行AVD时,都会说“应用程序已经停止”。究竟发生了什么?我该如何排除故障?我已经搜索了解决方案,但我找到的所有解决方案都无法解决。这是我的logcat的副本。
09-06 06:00:01.089: I/ProcessStatsService(380): Prepared write state in 73ms
09-06 06:00:15.499: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.499: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.509: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:15.519: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:15.519: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:15.519: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
09-06 06:00:15.539: I/ActivityManager(380): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=ca.sfu.cmpt276.bfraser/.MainActivity} from pid 620
09-06 06:00:15.609: D/gralloc(49): Registering a buffer in the process that created it. This may cause memory ordering problems.
09-06 06:00:15.609: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.609: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/SurfaceFlinger(49): glCheckFramebufferStatusOES error -889700262
09-06 06:00:15.619: E/SurfaceFlinger(49): got GL_FRAMEBUFFER_COMPLETE_OES error while taking screenshot
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: E/libEGL(49): called unimplemented OpenGL ES API
09-06 06:00:15.619: W/WindowManager(380): Screenshot failure taking screenshot for (246x410) to layer 21005
09-06 06:00:15.729: I/Choreographer(620): Skipped 54 frames! The application may be doing too much work on its main thread.
09-06 06:00:15.889: D/dalvikvm(1252): Not late-enabling CheckJNI (already on)
09-06 06:00:15.889: I/ActivityManager(380): Start proc ca.sfu.cmpt276.bfraser for activity ca.sfu.cmpt276.bfraser/.MainActivity: pid=1252 uid=10058 gids={50058, 3003, 1028, 1015}
09-06 06:00:16.689: D/AndroidRuntime(1252): Shutting down VM
09-06 06:00:16.689: W/dalvikvm(1252): threadid=1: thread exiting with uncaught exception (group=0xb3ab3ba8)
09-06 06:00:16.709: E/AndroidRuntime(1252): FATAL EXCEPTION: main
09-06 06:00:16.709: E/AndroidRuntime(1252): Process: ca.sfu.cmpt276.bfraser, PID: 1252
09-06 06:00:16.709: E/AndroidRuntime(1252): java.lang.RuntimeException: Unable to start activity ComponentInfo{ca.sfu.cmpt276.bfraser/ca.sfu.cmpt276.bfraser.MainActivity}: android.view.InflateException: Binary XML file line #22: Error inflating class fragment
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread.access$800(ActivityThread.java:135)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.os.Handler.dispatchMessage(Handler.java:102)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.os.Looper.loop(Looper.java:136)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread.main(ActivityThread.java:5017)
09-06 06:00:16.709: E/AndroidRuntime(1252): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 06:00:16.709: E/AndroidRuntime(1252): at java.lang.reflect.Method.invoke(Method.java:515)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
09-06 06:00:16.709: E/AndroidRuntime(1252): at dalvik.system.NativeStart.main(Native Method)
09-06 06:00:16.709: E/AndroidRuntime(1252): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class fragment
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:713)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.Activity.setContentView(Activity.java:1929)
09-06 06:00:16.709: E/AndroidRuntime(1252): at ca.sfu.cmpt276.bfraser.MainActivity.onCreate(MainActivity.java:24)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.Activity.performCreate(Activity.java:5231)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
09-06 06:00:16.709: E/AndroidRuntime(1252): ... 11 more
09-06 06:00:16.709: E/AndroidRuntime(1252): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 5089000 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.common.GooglePlayServicesUtil.A(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.internal.u.I(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.internal.u.H(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.MapFragment$b.jz(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.dynamic.a.a(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.app.Activity.onCreateView(Activity.java:4785)
09-06 06:00:16.709: E/AndroidRuntime(1252): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:689)
09-06 06:00:16.709: E/AndroidRuntime(1252): ... 21 more
09-06 06:00:16.719: W/ActivityManager(380): Force finishing activity ca.sfu.cmpt276.bfraser/.MainActivity
09-06 06:00:17.029: I/WindowManager(380): Screenshot max retries 4 of Token{b4292878 ActivityRecord{b3f8dc40 u0 ca.sfu.cmpt276.bfraser/.MainActivity t5 f}} appWin=Window{b4418de8 u0 Starting ca.sfu.cmpt276.bfraser} drawState=4
09-06 06:00:17.029: W/WindowManager(380): Screenshot failure taking screenshot for (480x800) to layer 21010
09-06 06:00:17.559: W/ActivityManager(380): Activity pause timeout for ActivityRecord{b3f8dc40 u0 ca.sfu.cmpt276.bfraser/.MainActivity t5 f}
09-06 06:00:18.049: I/ActivityManager(380): Killing 1156:com.svox.pico/u0a40 (adj 15): empty for 5152s
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.619: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.639: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/Effect_Tick.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressStandard.ogg
09-06 06:00:18.669: E/SoundPool(380): error loading /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:18.669: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressSpacebar.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressDelete.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressReturn.ogg
09-06 06:00:18.679: E/SoundPool(380): error loading /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:18.679: W/AudioService(380): Soundpool could not load file: /system/media/audio/ui/KeypressInvalid.ogg
09-06 06:00:18.679: W/AudioService(380): onLoadSoundEffects(), Error -1 while loading samples
09-06 06:00:18.739: I/Process(1252): Sending signal. PID: 1252 SIG: 9
09-06 06:00:18.769: I/ActivityManager(380): Process ca.sfu.cmpt276.bfraser (pid 1252) has died.
09-06 06:00:18.859: I/Choreographer(380): Skipped 32 frames! The application may be doing too much work on its main thread.
09-06 06:00:19.309: W/InputMethodManagerService(380): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@b3d7fee0 attribute=null, token = android.os.BinderProxy@b42a02e0
: E/(): Device disconnected
答案 0 :(得分:0)
您的AndroidManifest文件配置不正确
插入元素以包含API密钥作为
的子元素<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="--- your API Key here ---"/>
请记住使用您自己的API密钥替换值。
请注意,您必须使用调试API密钥进行调试,然后再切换到发布密钥
添加MAPS_RECEIVE的权限和使用权限。
<permission
android:name="com.example.yourpackage.MAPS_RECEIVE"
android:protectionLevel="signature"></permission> <uses-permission
android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"/>
然后添加uses-permission:
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
这个可选的
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"/>
指定OpenGL ES 2的使用功能:
<uses-feature android:glEsVersion="0x00020000"
android:required="true"/>