android compilation error in Eclipse - android

Android requires .class compatibility set to 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.

Right click on the project select project properties.
goto java compiler and select java 1.6 instead of 1.7

This is nothing. This is because you have not set your Updated jre 1.7. Instead you have selected 1.6. But 1.7 is a updated jre 1.7.
So select it. And after that Right click on project -> Properties-> Android Tools > Fix Project Properties.
After that clean your project and run again.

right click on project -
java compiler - and on right hand side there is option to set java version.
over there you can set 1.7 if already installed.
or you set installed version of java over there

Related

Gradle version 2.2 is required. Current version is 1.6

I have tried everything to update gradle in Android 1.5.1 under windows 10, but nothing worked... it keeps saying Gradle version 2.2 is required. Current version is 1.6.
Appreciate any input
Thanks
In your project folder, navigate to you gradle.properties file inside gradle > wrapper folder. Change the version to the lastest 2.12 and resync your project.
distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-all.zip
Android Studio has a setting for ignoring the gradle version in the project and using a local distribution instead.
Under "Preferences" (or "Settings" on Windows) search for "Gradle" and select "Use default gradle wrapper" instead of "Use local gradle distribution.
Change to
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip
Then File|New|import Project

Android - "Parsing Data for android-21 failed"

Had the following error in Eclipse after installing Android 5.0 (SDK 21)
"Loading data for Android 5.0" has encountered a problem.
Parsing Data for android-21 failed
unsupported major.minor version 51.0
Try installing JDK 1.8 and reload Eclipse.
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Initially I was facing the same issue. I upgraded to JDK1.7. Still issue persist. This is due to the fact that some time eclipse takees the default sdk as 1.6. To resolve this:
Change the environmental path to point 1.7/1.8
Open Eclipse and goto windows tab-> preference
Goto Java->complier and set Compiler compliance level to 1.7 and press apply.
Then Goto Installed JRE Section. check if the installed jdk is listed and selected in the list. If not listed give the manual path using search. then select the jdk version and remove other versions in the list.
in installed JRE go to execution environment and select the intended java se version and check it in compatible section
Presss ok and restart Eclipse.
This should resolve the issue.
I tried all above mention step, but not able to solve the problem.
After some research, I got Solution of my problem.
check eclipse.ini to see -vm, (like "C:/Program Files/Java/jre7/bin/javaw.exe").
i also have the problem you said and i found eclipse is started with java6. after i modify to use java7, there are no such fail dialog.
So need to update SDK to 1.8 or 1.7.
set compiler to 1.7 or 1.8..
then check eclipse.ini
Installing JDK 1.8 and reload Eclipse worked for me
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

unable to build Android project using Facebook SDK against Android 2.2 (Froyo)

I've recently started getting into programming with the Facebook SDK for Android, which I used to write a basic sample app. I want it to be able to run on as many systems as possible, so I set the build target to Android 2.2 (Froyo/API level 8). However, this results in the following error:
Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 8 FacebookTestApp
In comparison, all of the sample apps that came with the Facebook SDK have their build target set to Android 2.2, and none of them have this problem. Anyone know what I might be doing wrong?
Thanks.
I had the same problem today, this is how I fixed it:
Righ click on your project > properties > Java compiler > enable "project specific settings"
Set Compiler compliance level to 1.6
re Build your project
Voila!
Using 1.7 requires compiling with Android 4.4 (KitKat); currently using API 8
Here is the solution:
Right click your project -> Properties -> Android -> Select the lasted Project Build Target
This is what worked for me.
Right click on your project > Android Tools > Fix Project Properties.
Refresh the project and clean+build it.
Project -> Clean... -> Clean all projects
Fixed this for me.
You can build with API level 19 and still define minimum API level to 8.

android facebook sdk errors

Hi I imported the sample projects from the facebook sdk into my eclipse environment. When building the projects I keep on getting the following error:
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
I have tried to do Android Tool > Fix Project Properties and also I have gone to Properties > Java Compiler and set the Compiler Compliance Level to 1.6 but that didn't work either.
This was a problem with my workspace. My workspace was set to 1.7 so even if I set the specific Compiler Compliance Level to 1.6 it would not work until I set the workspace compiler compliance level to 1.6

Error when opening previous android project in Eclipse

I need to open a previousely developed android application in Eclipse. The application has developper for the Android 1.6 target. When I import the project to the eclipse IDE it gives the following error.
Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties.
After that:Right click the the Project -> Android tools -> Fix project properties
Still I can't open the project. Does any one have experience this before or have any idea to get rid of this error.
Thans inadvance.
For Android you should use JDK 1.5 (5.0) or 1.6 (6.0). In your case you use JDK 1.7, and Android throws error about this.
First make sure that android 1.6 must be installed on your machine. Secondly java compiler 5.0 or 6.0 must be there if you not have download and installed.
So Set the appropriate java compiler for compilence.
For doing it--> Right click on project->properties->java compiler.
you can also change build target for the project by--> Right click on project->properties->Android
I think you have entered a wrong Java version, you asked for 1.7 (which is not Java 7 as some are referring) when it requires at least Java 5.
So try to change the version from 1.7 to 7 or to the one you have.
This is done in the manifest file I think

Categories

Resources