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