Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Graphical Layout unable to display adView

I updated from Eclipse Helios to Eclipse Juno, updated Android SDK tools to v23, and Google Play lib 4.4.

Since them i am unable to view XML layouts in eclipse Graphical Layout Window. I get following error.

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

Error Log

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

The error only shows when i add Google AdView XML in Layout, other wise Graphical Layout works fine.

<?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>

Any help would be appreciated.

like image 596
kasai Avatar asked Oct 20 '22 03:10

kasai


2 Answers

I still have a problem even change API to 19 based on a zhangxaochen's answer

I solve the problem after i Install JDK 1.7.

Java compiler in Windows -> Preferences -> Java -> compiler still use 1.6

like image 191
Plugie Avatar answered Oct 29 '22 01:10

Plugie


I bet you are using Java JDK 1.6.

You have to go to Eclipse -> Window -> Preferences -> Java -> Compiler and set compiler to 1.7. Ofcourse you must have Java JDK 1.7 installed. If you don't, install it and the problem will dissappear.

At least that was the case with me.

I hope it helps!

like image 36
Nick Avatar answered Oct 28 '22 23:10

Nick