can't build android app with facebook sdk

Hello,

we are trying to integrate facebook sdk on our project, but we are stuck after the correct generation of the hash key.

FB Init() work correctly in play mode, i receive logging in =true;

But

when i try to build my apk for Android i get this error:

Error building Player: Win32Exception: ApplicationName=‘C:\Program Files (x86)\Java\jre7\bin\javac.exe’, CommandLine=‘-bootclasspath “C:/Users/gabriele/AppData/Local/Android/android-sdk/platforms/android-19\android.jar” -d “E:\unity4Projects est estLogin1.2\Temp\StagingArea\bin\classes” -source 1.6 -target 1.6 -encoding ascii “com\ExclusiveStudios\myGame\R.java” “com\facebook\android\R.java”’, CurrentDirectory=‘E:\unity4Projects est estLogin1.2\Temp\StagingArea\gen’

we searched a lot around for information and we tryed some different options offered by this fantastic comunity, but none worked, if we understand correctly there should be a problem on android Manifest Main Activity?

We are currently experimenting with just the facebook sdk with the demo sceene, so nothing else could create bugs.

It seems that this is a problem which a lot of us has found, but we haven’t found the answer.

Thank you

We are experiencing the very same problem and haven't found a solution yet.

–

Same problem here! any news?

–

Still not solved

–

I've seen may solutions which said to to install x86 Java in addition to x64. This didn't help me. Anyone tried this?

–

I tryed everything i found around in these forum to the point that i think i'll format my c: and do a new clean install.. this plugin is the first one i tryed without any success in 2 years. This plugin shouldn't be on asset store because as it is now on android doesn't work or should be stated that doesn't work on android without heavvy java skills which the normal unity developer doesn't focus on. That's of course is my opinion..

–

5 Answers

5

Got it working guyz… I am using Windows 8.1 pro 64 bit.
Download the latest Facebook SDK. Download Java 6 SDK 32-bit. It will work.
Caution: Even if you are using a 64 bit OS, use only Java 6 SDK 32 bit. Java 7 does not work.
Links:

  1. Facebook SDK
  2. Java 6 SDK ( 32-bit)

And please make sure, you are downloading Java SE Development Kit 6u45 and nothing else.

Thanks! Installking Java 6 32-bit helped!

–

If you want to build a project with the Facebook Unity SDK you have to make sure that you ONLY have the Java SDK, not the JRE.

If you have the JRE installed, it will crash.

ok the only way to make a build without that error is to use FB SDK 4.2.4 which are old.

that’s not a real solution because we can’t use the latest sdk but at least i can get a
build.

Hope this helps you guys.

thanks, worked

–

Try easy facebook android sdk , it’s simple LGPL library for android.

Look at the images below, you see I have 2 game objects, both have the same Interaction scripts, but each of them will enable different scripts in Interaction script. One will enable HaveObject, the other one will enable DropObject. I need a variable in Interaction script which can be differed from object to object, and ofcourse the type must be a c# script. [40028-ua1.png|40028] [40029-ua2.png|40029]

–

You may try to remove this aar ( which is duplicated in FB SDK with android SDK )

Assets\Plugins\Android\support-v4-25.3.1.aar