I get several errors when I try to call the class UiLifecycleHelper
in a plugin between Eclipse and Unity. I copied the facebooksdk.jar in the libs
folder of my project, then added it in
- Properties > Java Build Path > Add JAR
I also tried to simply add the "library" in :
- Properties > Android, with the button
Add...
There are no errors when I don't use the class UiLifecycleHelper
(the Log.i
works fine from testFunc
without the class UiLifecycleHelper
) And without the connection with Unity, with a simple class extending Activity, it connects well to Facebook.
I also set the Java Compiler to 1.6 as recommended in other topics.
Would you know how to correctly make the connection between the facebook .jar
and my project?
Here are the logs :
01-05 17:17:53.834: E/dalvikvm(25005): Could not find class 'com.project.aef.MainActivity$1', referenced from method com.project.aef.MainActivity.<init>
01-05 17:17:53.835: E/dalvikvm(25005): Could not find class 'com.facebook.UiLifecycleHelper', referenced from method com.project.aef.MainActivity.onCreate
01-05 17:17:53.841: E/AndroidRuntime(25005): FATAL EXCEPTION: main
01-05 17:17:53.841: E/AndroidRuntime(25005): java.lang.NoClassDefFoundError: com.project.aef.MainActivity$1
01-05 17:17:53.841: E/AndroidRuntime(25005): at com.project.aef.MainActivity.<init>(MainActivity.java:24)
01-05 17:17:53.841: E/AndroidRuntime(25005): at java.lang.Class.newInstanceImpl(Native Method)
01-05 17:17:53.841: E/AndroidRuntime(25005): at java.lang.Class.newInstance(Class.java:1319)
01-05 17:17:53.841: E/AndroidRuntime(25005): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
EDIT : I had a similar issue with Twitter, I finally changed the code to use Activities instead of the current code, I don't know why the code works fine outside the software, and not when I connect to it. I also used Libgdx to make the game, instead of Unity. Problem solved.