wang1986one / loon-simple

Automatically exported from code.google.com/p/loon-simple
0 stars 0 forks source link

about addView #82

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
使用addView()

What is the expected output? What do you see instead?
預期是希望可以透過addView()將廣告窗體插入遊戲畫面,但執��
�後總是發生異常強制關閉。LogCat顯示NullPointerException。

What version of the product are you using? On what operating system?
LGame0.3.2 LAE-1.1 
GoogleAdMobAdsSdkAndroid-6.1.0
Project Build : android4.1 api16

Please provide any additional information below.
以下為LogCat

08-21 15:43:41.673: E/AndroidRuntime(560): Uncaught handler: thread main 
exiting due to uncaught exception
08-21 15:43:41.693: E/AndroidRuntime(560): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.example.hk4g4/com.example.hk4g4.Main}: 
java.lang.NullPointerException
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.os.Handler.dispatchMessage(Handler.java:99)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.os.Looper.loop(Looper.java:123)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread.main(ActivityThread.java:4363)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
java.lang.reflect.Method.invokeNative(Native Method)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
java.lang.reflect.Method.invoke(Method.java:521)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
dalvik.system.NativeStart.main(Native Method)
08-21 15:43:41.693: E/AndroidRuntime(560): Caused by: 
java.lang.NullPointerException
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
com.example.hk4g4.Main.onMain(Main.java:37)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
org.loon.framework.android.game.LGameAndroid2DActivity.onCreate(LGameAndroid2DAc
tivity.java:78)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
com.example.hk4g4.Main.onCreate(Main.java:14)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-21 15:43:41.693: E/AndroidRuntime(560):  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-21 15:43:41.693: E/AndroidRuntime(560):  ... 11 more

Original issue reported on code.google.com by sasacat0...@gmail.com on 21 Aug 2012 at 4:03

GoogleCodeExporter commented 9 years ago
抱歉,LogCat是這一份。

08-21 16:05:06.313: D/AndroidRuntime(669): Shutting down VM
08-21 16:05:06.313: W/dalvikvm(669): threadid=3: thread exiting with uncaught 
exception (group=0x4001b188)
08-21 16:05:06.313: E/AndroidRuntime(669): Uncaught handler: thread main 
exiting due to uncaught exception
08-21 16:05:06.333: E/AndroidRuntime(669): java.lang.RuntimeException: Unable 
to start activity ComponentInfo{com.example.hk4g4/com.example.hk4g4.Main}: 
java.lang.NullPointerException
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread.access$2200(ActivityThread.java:119)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.os.Handler.dispatchMessage(Handler.java:99)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.os.Looper.loop(Looper.java:123)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread.main(ActivityThread.java:4363)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
java.lang.reflect.Method.invokeNative(Native Method)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
java.lang.reflect.Method.invoke(Method.java:521)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
dalvik.system.NativeStart.main(Native Method)
08-21 16:05:06.333: E/AndroidRuntime(669): Caused by: 
java.lang.NullPointerException
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.view.ViewGroup.addViewInner(ViewGroup.java:1860)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.view.ViewGroup.addView(ViewGroup.java:1756)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.view.ViewGroup.addView(ViewGroup.java:1736)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
org.loon.framework.android.game.LGameAndroid2DActivity.addView(LGameAndroid2DAct
ivity.java:488)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
com.example.hk4g4.Main.onMain(Main.java:40)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
org.loon.framework.android.game.LGameAndroid2DActivity.onCreate(LGameAndroid2DAc
tivity.java:78)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
com.example.hk4g4.Main.onCreate(Main.java:14)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-21 16:05:06.333: E/AndroidRuntime(669):  at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
08-21 16:05:06.333: E/AndroidRuntime(669):  ... 11 more
08-21 16:05:06.353: I/dalvikvm(669): threadid=7: reacting to signal 3
08-21 16:05:06.364: E/dalvikvm(669): Unable to open stack trace file 
'/data/anr/traces.txt': Permission denied

Original comment by sasacat0...@gmail.com on 21 Aug 2012 at 4:07