简体   繁体   English

Android Facebook SDK导入时出现错误 - Eclipse

[英]Android Facebook SDK import occurs with errors - Eclipse

I'm sort of desperate with this question. 我有点绝望地回答这个问题。 I've been stuck on this for days and need help. 我已经坚持了几天,需要帮助。 Please let me know if you can help at all. 如果您能提供帮助,请告诉我。

I'm following the Facebook tutorial and all goes well until I get to step "Step 3: Create New Facebook SDK Project". 我正在关注Facebook教程 ,一切顺利,直到我进入“第3步:创建新的Facebook SDK项目”。 After following the steps EXACTLY as on the site, and on many different tutorials on the web, the com_facebook_android project is full of errors. 按照网站上的完整步骤以及网上的许多不同教程完成后,com_facebook_android项目充满了错误。 The errors occur in Facebook.java and FbDialog.java. 错误发生在Facebook.java和FbDialog.java中。 I do nothing and from the beginning the error are there. 我什么都不做,从一开始就有错误。

无题1

I've tried 我试过了

  1. creating the project from existing source 从现有源创建项目
  2. importing the project 导入项目
  3. re-creating the project from scratch 从头开始重新创建项目

None of these attempts work. 这些尝试都不起作用。 Is there a step missing that I didn't do? 我没有做过一个缺失的步骤吗? Does anyone else have this problem? 还有其他人有这个问题吗?

Here are all the errors. 以下是所有错误。 Please, please, someone help. 拜托,请有人帮忙。

Facebook.java Facebook.java

The method onServiceConnected(ComponentName, IBinder) of type Facebook.TokenRefreshServiceConnection must override a superclass method

The method onServiceDisconnected(ComponentName) of type Facebook.TokenRefreshServiceConnection must override a superclass method

FbDialog.java FbDialog.java

The method onClick(View) of type new View.OnClickListener(){} must override a superclass method

Removing the override annotation just causes more errors. 删除覆盖注释只会导致更多错误。

Please help. 请帮忙。

try this: 试试这个:

right click your project -> properties -> java compiler 右键单击您的项目 - > properties - > java compiler

select enable project specific , and select compiler comp level to 1.6 选择enable project specific ,并选择compiler comp level为1.6

idiottiger's response worked for me too, but it's important to note you probably need to restart Eclipse (I did) after the change. idiottiger的回复也适用于我,但重要的是要注意你可能需要在更改后重启Eclipse(我做过)。

That's the last time I'll update Eclipse! 那是我最后一次更新Eclipse! Post update, it wouldn't start up again, and I had to do a clean install, which lead me to this issue with an imported project. 更新后,它不会重新启动,我不得不进行全新安装,这导致我导入项目的这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM