New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoClassDefFoundError: com.facebook.android.R$layout #537
Comments
Your application does not have Android Internet Permissions setup. http://developer.android.com/reference/android/Manifest.permission.html#INTERNET |
To make the CLI installation more automatic, couldn't something like the following be added to plugin.xml:
|
I'm actually having this issue as well, but I have the INTERNET permissions defined in my manifest. Any thoughts? |
Adding the INTERNET permission was not enough to work for me either. My project for some reason was not including the FacebookLib library project when building but I couldn't clearly see why. I would think that if using the CLI to build all that would be needed is to list the FacebookLib as an android.library.reference in the root project.properties file. Just in case that wasn't enough I messed around with my IDE build settings and set the FacebookLib dependency to Compile scope and to Export. Eventually this error went away but I can't way with 100% certainty what change I made that actually fixed it. I'm not building using my IDE really, I'm running "cordova build" so I wouldn't think my dependencies and build settings in the IDE would have any bearing on the CLI process, but I could be wrong... |
@perilousleigh Thanks for the feedback, perhaps we should add internet permissions. Regarding non-IDE use; we recently added that to the docs on develop branch: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/develop/platforms/android/README.md#setup-without-eclipse-just-cli |
I was having the same problem, was able to build correctly but at runtime I got the error java.lang.NoClassDefFoundError: com.facebook.android.R$layout The last link by @aogilvie solved the issue and now it's working perfectly, thanks! |
@aogilvie THANKS! That doc solved my problem. |
sorry but i followed the new docs on develop branch and i've got the same issue :
|
Well, I had this issue and the I mean, my project is gonna work for me now, until I have to reinstall a new version of the plugin, or until I have to update cordova and rebuild the whole platforms folder, or until a new member of my team has to checkout the project or switch branches, and so on. I'll have to do Maybe this is a cordova issue, seeing that Please let me know if it's not at this plugin's reach to solve this, and I'll gladly take this up to the cordova ML or jira. |
@fredgalvao Have a poke around here https://issues.apache.org/jira/browse/CB/component/12320402/?selectedTab=com.atlassian.jira.jira-projects-plugin:component-summary-panel |
Was waiting on an answer about whether this plugin could solve it or not before taking it up, but I created this issue anyway. Please add to it if you have anything to add. |
@fredgalvao That does sound like a bug with |
It is indeed: this one right here I'll switch from ant to gradle soon, and the issue should be gone. However, using hooks would solve the issue indeed, but I'd suggest using the |
Caused by: java.lang.NoClassDefFoundError: com.facebook.drawee.R$styleable |
I meet the same problem
|
I getting this error: java.lang.NoClassDefFoundError: com.facebook.android.R$layout
When i call:
facebookConnectPlugin.login(["basic_info"],
function(){ alert("Success") },
function () { alert(":(") }
);
07-02 20:25:53.577: D/HAWAII_EGL(18108): eglMakeCurrent(0x4fced2d0, 0x4fced2f0, 0x4fced2f0) Thread: 18108
07-02 20:25:53.717: V/WebViewInputDispatcher(18108): blockWebkitDraw
07-02 20:25:53.717: V/WebViewInputDispatcher(18108): blockWebkitDraw lockedtrue
07-02 20:25:54.047: D/webview(18108): blockWebkitViewMessage= false
07-02 20:25:54.167: D/ConnectPlugin(18108): login FB
07-02 20:25:54.217: W/dalvikvm(18108): VFY: unable to resolve static field 2311 (com_facebook_internet_permission_error_title) in Lcom/facebook/android/R$string;
07-02 20:25:54.217: D/dalvikvm(18108): VFY: replacing opcode 0x60 at 0x0010
07-02 20:25:54.227: I/dalvikvm(18108): DexOpt: unable to optimize static field ref 0x0906 at 0x18 in Lcom/facebook/AuthorizationClient;.checkInternetPermission
07-02 20:25:54.378: W/dalvikvm(18108): VFY: unable to resolve static field 2301 (com_facebook_login_activity_layout) in Lcom/facebook/android/R$layout;
07-02 20:25:54.378: D/dalvikvm(18108): VFY: replacing opcode 0x60 at 0x0003
07-02 20:25:54.378: W/dalvikvm(18108): VFY: unable to resolve static field 2284 (com_facebook_login_activity_progress_bar) in Lcom/facebook/android/R$id;
07-02 20:25:54.378: D/dalvikvm(18108): VFY: replacing opcode 0x60 at 0x0008
07-02 20:25:54.498: D/dalvikvm(18108): GC_CONCURRENT freed 532K, 18% free 8838K/10748K, paused 4ms+7ms, total 46ms
07-02 20:25:54.588: D/CordovaActivity(18108): Paused the application!
07-02 20:25:54.588: D/CordovaWebView(18108): Handle the pause
07-02 20:25:54.588: D/WebView(18108): loadUrlImpl: called
07-02 20:25:54.648: W/PluginManager(18108): THREAD WARNING: exec() call to FacebookConnectPlugin.login blocked the main thread for 480ms. Plugin should use CordovaInterface.getThreadPool().
07-02 20:25:54.748: D/webcore(18108): CORE loadUrl: called
07-02 20:25:54.748: D/webkit(18108): Firewall not null
07-02 20:25:54.748: D/webkit(18108): euler: isUrlBlocked = false
07-02 20:25:54.908: D/AndroidRuntime(18108): Shutting down VM
07-02 20:25:54.908: W/dalvikvm(18108): threadid=1: thread exiting with uncaught exception (group=0x420af930)
07-02 20:25:54.938: E/AndroidRuntime(18108): FATAL EXCEPTION: main
07-02 20:25:54.938: E/AndroidRuntime(18108): java.lang.NoClassDefFoundError: com.facebook.android.R$layout
07-02 20:25:54.938: E/AndroidRuntime(18108): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.Activity.performCreate(Activity.java:5326)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2218)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.ActivityThread.access$700(ActivityThread.java:157)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.os.Handler.dispatchMessage(Handler.java:99)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.os.Looper.loop(Looper.java:176)
07-02 20:25:54.938: E/AndroidRuntime(18108): at android.app.ActivityThread.main(ActivityThread.java:5317)
07-02 20:25:54.938: E/AndroidRuntime(18108): at java.lang.reflect.Method.invokeNative(Native Method)
07-02 20:25:54.938: E/AndroidRuntime(18108): at java.lang.reflect.Method.invoke(Method.java:511)
07-02 20:25:54.938: E/AndroidRuntime(18108): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
07-02 20:25:54.938: E/AndroidRuntime(18108): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
07-02 20:25:54.938: E/AndroidRuntime(18108): at dalvik.system.NativeStart.main(Native Method)
The text was updated successfully, but these errors were encountered: