【问题标题】:Eclipse Graphical Layout unable to display adViewEclipse 图形布局无法显示 adView
【发布时间】:2014-10-09 12:03:51
【问题描述】:

我从 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>

任何帮助将不胜感激。

【问题讨论】:

    标签: android eclipse layout adview


    【解决方案1】:

    根据张晓晨的回答,即使将 API 更改为 19,我仍然有问题

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

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

    【讨论】:

      【解决方案2】:

      我打赌你使用的是 Java JDK 1.6。

      您必须转到 Eclipse -> Window -> Preferences -> Java -> Compiler 并将编译器设置为 1.7。当然,您必须安装 Java JDK 1.7。如果不这样做,请安装它,问题就会消失。

      至少我是这样的。

      希望对你有帮助!

      【讨论】:

        【解决方案3】:

        我解决了刚才的问题,将渲染布局时使用的android版本改为API 19,默认为API 20:

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-11-09
          • 1970-01-01
          • 1970-01-01
          • 2012-06-17
          • 2012-06-19
          • 2011-10-17
          • 1970-01-01
          • 2016-04-01
          相关资源
          最近更新 更多