android - Eclipse 图形布局无法显示 adView

标签 android eclipse layout adview

我从 Eclipse Helios 更新到 Eclipse Juno,将 Android SDK 工具更新到 v23,以及 Google Play lib 4.4。

因为他们,我无法在 Eclipse 图形布局窗口中查看 XML 布局。我收到以下错误。

Exception raised during rendering: com/google/android/gms/ads/AdView : Unsupported major.minor version 51.0
Exception details are logged in Window > Show View > Error Log

错误日志

Could not create the view: org.eclipse.pde.runtime.LogView

该错误仅在我在布局中添加 Google AdView XML 时显示,否则图形布局工作正常。

<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  xmlns:ads="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent" >

    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        ads:adSize="BANNER"
        ads:adUnitId="xxxxxxxxxxxxxxxxxxxxxxxx" />

</RelativeLayout>

如有任何帮助,我们将不胜感激。

最佳答案

根据zhangxaochen的回答把API改成19还是有问题

我在安装JDK 1.7 后解决了这个问题。

Windows 中的 Java 编译器 -> 首选项 -> Java -> 编译器仍使用 1.6

关于android - Eclipse 图形布局无法显示 adView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25331730/

相关文章:

java - 无法使用 Selenium webdriver 写入 Excel

javascript - 重新设计或开发类似 outlook 的日历作为网络版本

Java FX - BarChart动态添加的内容破坏了布局

android:以编程方式本地化动态字符串

android - 制作 Android 应用程序时是否有需要注意的内存管理技巧?

java - "create new visual classes"按钮在 eclipse 上不可点击

java - 我可以从 Eclipse 创建的命令行程序运行吗?

java - Android 检测到 instanceof EditText 和 instanceof TextView 相同

android - ImageView 的大小

android - 不支持 320x480 以下分辨率的正确方法是什么