为什么“在adapterview中不支持addView”错误在gradle编译'com.google.android.gms:play-services-ads:10.2.0'中添加广告依赖性

时间:2017-02-21 12:48:27

标签: android

当我添加广告依赖项时,会给出错误

 FATAL EXCEPTION: main
              Process: com.unnamed.b.atv.demo, PID: 1342
              java.lang.RuntimeException: Unable to start activity ComponentInfo{com.unnamed.b.atv.demo/com.unnamed.b.atv.sample.activity.SingleFragmentActivity}: java.lang.UnsupportedOperationException: addView(View) is not supported in AdapterView
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2656)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721)
                  at android.app.ActivityThread.access$900(ActivityThread.java:168)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
                  at android.os.Looper.loop(Looper.java:135)
                  at android.app.ActivityThread.main(ActivityThread.java:5753)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at java.lang.reflect.Method.invoke(Method.java:372)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)
               Caused by: java.lang.UnsupportedOperationException: addView(View) is not supported in AdapterView
                  at android.widget.AdapterView.addView(AdapterView.java:469)
                  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1120)
                  at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1286)
                  at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:758)
                  at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1671)
                  at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
                  at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:619)
                  at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1232)
                  at android.app.Activity.performStart(Activity.java:6147)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2721) 
                  at android.app.ActivityThread.access$900(ActivityThread.java:168) 
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1393) 
                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                  at android.os.Looper.loop(Looper.java:135) 
                  at android.app.ActivityThread.main(ActivityThread.java:5753) 
                  at java.lang.reflect.Method.invoke(Native Method) 
                  at java.lang.reflect.Method.invoke(Method.java:372) 
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1405) 
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200) 

0 个答案:

没有答案