无法引用com.facebook.widget.LoginButton [英] unable to reference com.facebook.widget.LoginButton

查看:639
本文介绍了无法引用com.facebook.widget.LoginButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,它使用Facebook的SDK(使用最新版本,3.6)的Andr​​oid应用程序。这是我第一次使用SDK,并试图起床根据样品中的例子$ C $可用C(美味的)简单的登录页面的工作。我无法解析LoginButton在我的XML布局。它无法引用com.facebook.widget.LoginButton。我试图复制类文件LoginButton源到我命名FBLoginButton自己的类,然后进行编辑布局文件看起来是这样的:

I am working on an android app which uses the Facebook SDK (using the latest version, 3.6). This is my first time working with the SDK and trying to get up the simple login page work based on the example code available in the samples (scrumptious). I am unable to resolve the LoginButton in my xml layout. It is unable to reference com.facebook.widget.LoginButton. I tried copying the class file LoginButton source into my own class named FBLoginButton and then edited the layout file to look like this:

        <!-- <com.facebook.widget.LoginButton -->
        <!--<com.facebook.scrumptious.LoginButton  -->

        <com.example.myproject.FBLoginButton 
            android:id="@+id/login_button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="30dp"
            android:layout_marginBottom="30dp" />

虽然我的课FBLoginButton是自由本身就是错误的,我得到的错误:

While my class FBLoginButton is free of errors in itself, I get the error:

The following classes could not be instantiated:
- com.example.insultdroid.FBLoginButton (Open Class, Show Error Log)

我已经花了无数的时间试图让LoginButton的工作,但没有成功。重建,清洗,重新启动Eclipse的;我已经做了这一切!有人可以帮我!

I have already spent endless hours trying to get the LoginButton to work but to no success. Rebuilding, cleaning, restarting eclipse; I have done it all! Can someone please help me!

添加一个快照显示,LoginButton类中,我已经添加到依赖关系facebooksdk.jar可用。

Adding a snapshot that shows that LoginButton class is available in the facebooksdk.jar which I have added to the dependencies.

推荐答案

您正从事该项目... 有您导入Facebook的SDK和添加库当前项目?(右键点击>项目>的Andr​​oid>添加...在库部分按钮)。或检查您的Java构建路径 - >订单和出口,确保Facebook的库检查

The project you're working on... have you imported the Facebook SDK and added the library to your current project? (right click > Project > Android > Add... button in library section). Or check your Java build path -> Order and Export and make sure the facebook library is checked.

如果你有,那么它应该工作......,如果你还没有,添加库,它应该工作。

If you have, then it should work..., if you haven't, add the library and it should work.

此外,确保Android的下依赖> facebooksdk.jar,你看到com.facebook.widget.LoginButton。

Also, make sure under Android dependencies > facebooksdk.jar, that you see com.facebook.widget.LoginButton.

如果它仍然不能正常工作,请尝试删除Facebook的库,重新添加它,关闭并重新启动Eclipse。

If it's still not working, try deleting the facebook library, re-adding it, close and restart Eclipse.

这篇关于无法引用com.facebook.widget.LoginButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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