2014-09-06 56 views
0

問候! 預先感謝您查看我的問題。我想在模擬器(Eclipse)中運行Google Map,但每次運行AVD時,都會顯示「應用程序已停止」。究竟發生了什麼?我如何解決它?我已經尋找解決方案,但是我找到的所有解決方案都無法解決。這裏是我的logcat的副本。如何解決此Google Map V2 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: [email protected] attribute=null, token = [email protected] 
: E/(): Device disconnected 
+0

能否請您發表您的清單.. – Lal 2014-09-06 15:37:45

回答

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 
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"/>