Eclipse graphic layout cannot display adView

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

Since then I can not view XML layouts in the eclipse graphic layout window. I get the 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 is only displayed if I add the Google AdView XML code to the layout, and another wise graphic 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.

+5
source share
3 answers

I still have a problem even with changing API to 19 based on zhangxaochen answer

I solve the problem after installing JDK 1.7.

Java Compiler on Windows -> Preferences -> Java -> Compiler Still Using 1.6

+2
source

I bet you are using Java JDK 1.6.

You need to go to Eclipse -> Window -> Preferences -> Java -> Compiler and install the compiler in 1.7. Of course, you must have Java JDK 1.7 installed. If you do not, install it and the problem will disappear.

At least that was the case with me.

Hope this helps!

+1
source

I solved the problem only now, changing the version of Android to use when rendering layouts to API 19 , by default it is API 20 :

enter image description here

0
source

Source: https://habr.com/ru/post/1200437/


All Articles