Hello everyone,
I got some problems when I used the Facebook plugin at the runtime compiled by the Corona Enterprise.
Now the Facebook sdk is as the corona plugin. I’ve built it successfully.
But when I run it on device, I got crash error from logical:
===================
dalvikvm( 4000): VFY: unable to resolve static field 4013 (com_facebook_internet_permission_error_title) in Lcom/facebook/android/R$string;
D/dalvikvm( 4000): VFY: replacing opcode 0x60 at 0x0010
I/dalvikvm( 4000): DexOpt: unable to optimize static field ref 0x0fac at 0x18 in Lcom/facebook/AuthorizationClient;.checkInternetPermission
W/dalvikvm( 4000): VFY: unable to resolve static field 4002 (com_facebook_login_activity_layout) in Lcom/facebook/android/R$layout;
D/dalvikvm( 4000): VFY: replacing opcode 0x60 at 0x0003
W/dalvikvm( 4000): VFY: unable to resolve static field 3982 (com_facebook_login_activity_progress_bar) in Lcom/facebook/android/R$id;
D/dalvikvm( 4000): VFY: replacing opcode 0x60 at 0x0008
W/dalvikvm( 8469): threadid=1: thread exiting with uncaught exception (group=0x418b3ba8)
W/System.err( 8469): java.lang.NoClassDefFoundError: com.facebook.android.R$layout
W/System.err( 8469): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
W/System.err( 8469): at android.app.Activity.performCreate(Activity.java:5231)
W/System.err( 8469): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
W/System.err( 8469): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
W/System.err( 8469): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
W/System.err( 8469): at android.app.ActivityThread.access
====================
I just have no idea how that happened. Here is my directory structure:
-rw-r–r--@ 1 willyma staff 242 12 4 03:08 AndroidManifest.plugin.xml
-rw-r–r--@ 1 willyma staff 6090 1 12 09:29 AndroidManifest.xml
-rw-rw-r–@ 1 willyma staff 166 12 11 17:32 ant.properties
drwxr-xr-x 46 willyma staff 1564 1 12 13:32 assets
drwxr-xr-x 23 willyma staff 782 1 12 13:32 bin
-rwxr-xr-x@ 1 willyma staff 3095 12 4 03:08 build.plugin.sh
-rw-r–r--@ 1 willyma staff 4055 12 4 03:08 build.plugin.xml
-rwxr-xr-x@ 1 willyma staff 2414 12 4 03:08 build.sh
-rw-r–r--@ 1 willyma staff 5070 12 11 17:28 build.xml
-rwxr-xr-x@ 1 willyma staff 2412 12 11 17:10 build_debug.sh
drwxr-xr-x 5 willyma staff 170 1 12 09:16 gen
drwxr-xr-x 10 willyma staff 340 1 7 11:42 libs
-rw-r–r-- 1 willyma staff 434 1 12 13:31 local.properties
-rw-r–r--@ 1 willyma staff 781 1 12 13:31 proguard-project.txt
-rw-r–r--@ 1 willyma staff 382 12 4 03:08 project.plugin.properties
-rw-r–r--@ 1 willyma staff 640 1 7 14:28 project.properties
drwxr-xr-x 17 willyma staff 578 12 13 10:41 res
drwxr-xr-x@ 5 willyma staff 170 12 9 14:31 src
What I have done:
- I put corona Facebook sdks into the directory libs, and its resource files into directory res.
- Put the correct Facebook related info into AndroidMenifest.xml
<uses-permission android:name=“android.permission.INTERNET”/>
<meta-data android:name=“com.facebook.sdk.ApplicationId” android:value="@string/facebook_app_id" />
<!-- Facebook SDK activities -->
<activity android:name=“com.facebook.LoginActivity”
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges=“keyboardHidden|screenSize|orientation”/>
<activity android:name=“facebook.FacebookFragmentActivity”
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges=“keyboardHidden|screenSize|orientation”/>
- add the string facebook_app_id = MyAPPID in the res/values/strings.xml yet
Just don’t know what I missed to make it run correctly.
Anyone know the reason please help me. I’ll appreciate for that.