所以我最近才更新到 ADT 20,这简直是一场噩梦。
我尝试了我在网上找到的所有解决方案。1. 我将 jar 放入 LIBS 文件夹 2. 从构建路径中的 libary 选项卡添加 jar 并在导出路径中检查它 3. 我什至做了一件事情,有人说将 libs 文件夹设为源文件夹(我猜所以它被导出)
没有任何效果。请帮助这是一场噩梦。我根本不能使用任何外部罐子......
08-18 11:06:45.144: E/AndroidRuntime(3886): FATAL EXCEPTION: main
08-18 11:06:45.144: E/AndroidRuntime(3886): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.Main}: android.view.InflateException: Binary XML file line #15: Error inflating class com.google.ads.AdView
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1696)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1716)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread.access$1500(ActivityThread.java:124)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:968)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.os.Handler.dispatchMessage(Handler.java:99)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.os.Looper.loop(Looper.java:130)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread.main(ActivityThread.java:3806)
08-18 11:06:45.144: E/AndroidRuntime(3886): at java.lang.reflect.Method.invokeNative(Native Method)
08-18 11:06:45.144: E/AndroidRuntime(3886): at java.lang.reflect.Method.invoke(Method.java:507)
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-18 11:06:45.144: E/AndroidRuntime(3886): at dalvik.system.NativeStart.main(Native Method)
08-18 11:06:45.144: E/AndroidRuntime(3886): Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.google.ads.AdView
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.Activity.setContentView(Activity.java:1703)
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.example.test.Main.onCreate(Main.java:12)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1660)
08-18 11:06:45.144: E/AndroidRuntime(3886): ... 11 more
08-18 11:06:45.144: E/AndroidRuntime(3886): Caused by: java.lang.reflect.InvocationTargetException
08-18 11:06:45.144: E/AndroidRuntime(3886): at java.lang.reflect.Constructor.constructNative(Native Method)
08-18 11:06:45.144: E/AndroidRuntime(3886): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-18 11:06:45.144: E/AndroidRuntime(3886): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-18 11:06:45.144: E/AndroidRuntime(3886): ... 21 more
08-18 11:06:45.144: E/AndroidRuntime(3886): Caused by: java.lang.RuntimeException: Could not initialize AdView: Required XML attribute "adUnitId" missing
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.google.ads.AdView.a(SourceFile:417)
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.google.ads.AdView.<init>(SourceFile:129)
08-18 11:06:45.144: E/AndroidRuntime(3886): ... 24 more
08-18 11:06:45.144: E/AndroidRuntime(3886): Caused by: com.google.ads.internal.b: Required XML attribute "adUnitId" missing
08-18 11:06:45.144: E/AndroidRuntime(3886): at com.google.ads.AdView.a(SourceFile:360)
08-18 11:06:45.144: E/AndroidRuntime(3886): ... 25 more