似乎的IntelliJ IDEA 12使用Facebook的Andr​​oid SDK中时,没有得到Facebook的SDK资源 [英] Seem doesn't get Facebook SDK resource when using Facebook Android SDK in IntelliJ IDEA 12

查看:137
本文介绍了似乎的IntelliJ IDEA 12使用Facebook的Andr​​oid SDK中时,没有得到Facebook的SDK资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文章<一href="http://stackoverflow.com/questions/7262221/add-facebook-sdk-to-intellij-android-project">Add Facebook的SDK来的IntelliJ Android项目? ,我选择添加了 facebook.jar 的文件为依赖一节中一个模块在项目结构。在编译过程中正常工作。然而,当我试图用会话登录,在facebook登入,我得到了运行时错误信息是这样的:

According to the article Add facebook SDK to IntelliJ Android project?, I choose to add the "facebook.jar" file as a Module in the "Dependencies" section in the project structure. The compile process works fine. However, when I trying to using "Session Login" to login in facebook, I got the runtime error message like this:

02-06 20:15:56.648: ERROR/AndroidRuntime(5891): FATAL EXCEPTION: main
    java.lang.NoClassDefFoundError: com.facebook.android.R$layout
    at com.facebook.LoginActivity.onCreate(LoginActivity.java:55)
    at android.app.Activity.performCreate(Activity.java:4524)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2115)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2189)
    at android.app.ActivityThread.access$600(ActivityThread.java:139)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:4894)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    at dalvik.system.NativeStart.main(Native Method)

它看起来像facebook.jar不包含布局资源本身在Facebook的SDK提供的?不知道我是对还是错。我导入当前项目和建设,并通过Eclipse中运行我的应用程序,它的工作就像一个魅力。一切完美的作品。然而,作为一个IntelliJ IDEA的保护者,我想争取,如果有人可以提供这个问题的解决方案。非常感谢。

It looks like the facebook.jar doesn't contain the layout resource itself provided in facebook sdk? Don't know if I am right or wrong. I do import the current project and build and run my app via eclipse, and it work like a charm. Everything works flawlessly. However, being a IntelliJ IDEA favorer, I would like to seek if anyone could provide solution for this issue. Many thanks.

推荐答案

OK,终于拿到了Android SDK中为我工作的facebook的。下面是步骤,我做的顺序。

OK, finally got the facebook android SDK worked for me. Here are the order of steps I did.

  1. 打开了,并在当前的Andr​​oid项目,然后选择文件 | 新建模块
  2. 选择库模块的左侧面板上。
  3. 在右侧面板上填写所需信息。在这里,我只是给出了:
    • 模块名称:脸谱
    • 内容根:选择好下载Facebook的Andr​​oid SDK中的,而且一定要选择命名的子文件夹脸谱


    • 模块文件位置:相同内容的根
    • 包名称:com.facebook.android(?猜测可以指定任意
  1. Open up and be in your current android project then select File | New Module
  2. Choose "Library Module" on the left-side panel.
  3. Fill in the required information on the right-side panel. Here I just given the:
    • Module name: "facebook"
    • Content root: Choose where the downloaded facebook android SDK is, and be sure to select the subfolder named "facebook"


    • Module file location: same as Content root
    • Package name: com.facebook.android (Guess could assign arbitrarily?)

这篇关于似乎的IntelliJ IDEA 12使用Facebook的Andr​​oid SDK中时,没有得到Facebook的SDK资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆