android facebook sdk errors - android

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

Related

Error building default Native-Activity Android Project in Visual Studio 2015

I am attempting to build the default project that is generated in VS 2015 for template type Cross Platform -> Native-Activity Application (Android) but immediately receive an error during build:
Output:
2> BUILD FAILED
2> C:\Users\T\AppData\Local\Android\sdk2\tools\ant\build.xml:538:
Unable to resolve project target 'android-19' :
Application Manifest:
The ApplicationManifest.xml file has the following settings:
uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23"
VS Options
Tools -> Options -> Cross Platform -> C++ -> Android SDK, Android NDK and Java SE Development Kit paths have been updated to match the settings I used successfully in Android Studio (for a different but equally simple native project). And the fourth path Apache Ant points to the newest version I just installed:
SDK 6.0 (API Level 23)
JDK 8.0
Ant 1.9.6
I have extensive VS experience (C# / C++) and good (but rusty) experience with Android/Java but no experience using VS to build for Android.
I am confused by the error in general, but am particularly confused because of the API level 19.
Any ideas about how to fix this?
Problem solved. When the Visual Studio solution is generated there are two projects added: [name].NativeActivity (C++) and [name].Packaging (Java).
Both project's properties allow Target API Level to be defined. Repeat these steps for both projects:
Solution Explorer > Right-click project (not solution) > Properties > Configuration Properties > General > Target API Level

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 compilation error in Eclipse

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

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

Git repo from Eclipse on W7 imported to Eclipse on Mac, why "compiler compliance level" error?

I have a small Android app developed in Eclipse on Windows and versioned on Github. Now that I cloned and imported it from Github to Eclipse on a Macbook, I get the error that "Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties."
I looked around here, and this seems to have something to do with the java version, but the java sdk installed on the Macbook is SE 6, same as on the Windows machine. Also the Android sdk versions are the same (the latest). So I have no clue what's going on... Any ideas, suggestions, anyone?
Also,,, if I do these fixes, whatever they are, will I have a problem after pulling to the Windows machine?
Even though you have JDK 6, you need to explicitly set compliance level Window--Preferences--Java-JRE--compilance level, change to 1.6.
It is eclipse level setting, so high possibility that it may happen on windows machine too.

Categories

Resources