[英]“could not find com_facebook_android.apk error” when running Android project
I've installed the Facebook API for Android in Eclipse, and imported the project into my Android project. 我在Eclipse中安装了Facebook的Android API,并将项目导入我的Android项目。 My program builds perfectly fine, but when I try to run it I get 我的程序构建完美,但是当我尝试运行它时,我得到了
Could not find com_facebook_android.apk! 找不到com_facebook_android.apk!
in the build window, and when the program actually tries to import any of the Facebook API classes it blows up with a java.lang.NoClassDefFoundError: com.facebook.android.Facebook
在构建窗口中,当程序实际上尝试导入任何Facebook API类时,它会java.lang.NoClassDefFoundError: com.facebook.android.Facebook
Probably you added the reference to the Java project in the "Java Build Path" but it's the wrong place. 您可能在“Java Build Path”中添加了对Java项目的引用,但这是错误的地方。
From the Android guide: 来自Android指南:
To add a reference to a library project, follow these steps: 要添加对库项目的引用,请按照下列步骤操作:
This resolved my problem. 这解决了我的问题。
In my case helped, not to have in the referenced projects checked Is Library
在我的情况下帮助,没有在引用的项目中检查Is Library
(Project Properties > Android) (项目属性> Android)
Check out referencing libraries instructions here: 在这里查看引用库指令:
http://developer.android.com/guide/developing/projects/projects-eclipse.html http://developer.android.com/guide/developing/projects/projects-eclipse.html
Make sure you have the latest versions of ADT. 确保您拥有最新版本的ADT。
Try to clean your project in eclipse. 尝试在eclipse中清理你的项目。
Hope this helps 希望这可以帮助
I am also having issues with this error and have noted that if I run eclipse as root then the error disappears. 我也遇到了这个错误的问题,并注意到如果我以root身份运行eclipse,那么错误就会消失。 This makes me think it is a permissions issue 这让我觉得这是一个权限问题
So to help: 所以帮助:
On the com Facebook android project right click > android tool > build and export 在Facebook Facebook项目右键单击> android工具>构建和导出
Then simply build the project into the bin folder of the Facebook project. 然后只需将项目构建到Facebook项目的bin文件夹中。
Problem solved 问题解决了
I had a similar problem. 我遇到了类似的问题。 This was my resolution. 这是我的决议。 I had to add android.jar as a reference. 我不得不添加android.jar作为参考。
If nothing works, try deleting the Facebook application for Android (if you have one installed on your phone). 如果无效,请尝试删除Android的Facebook应用程序(如果手机上已安装了该应用程序)。 This worked for me. 这对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.