当我将项目链接到已复制到项目 lib 文件夹中的 facebookSDK jar 文件而不是将项目链接到工作区中的 facebookSDK 库项目时,出现java.lang.NoClassDefFoundError: com.facebook.android.R$layout错误。当我链接到工作区中的库项目时,它工作正常。
谁能告诉我如何解决这个问题。我正在为 android 使用 facebook sdk 3.0。提前致谢。
编辑:在生成带有警告的 jar 文件后,我的 logcat 中出现以下错误
01-17 12:42:04.790: E/AndroidRuntime(3073): FATAL EXCEPTION: main
01-17 12:42:04.790: E/AndroidRuntime(3073): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.games.game/com.facebook.LoginActivity}: android.content.res.Resources$NotFoundException: File 296108030489520 from xml type layout resource ID #0x7f030001
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1816)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread.access$1500(ActivityThread.java:132)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1033)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.os.Handler.dispatchMessage(Handler.java:99)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.os.Looper.loop(Looper.java:143)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread.main(ActivityThread.java:4196)
01-17 12:42:04.790: E/AndroidRuntime(3073): at java.lang.reflect.Method.invokeNative(Native Method)
01-17 12:42:04.790: E/AndroidRuntime(3073): at java.lang.reflect.Method.invoke(Method.java:507)
01-17 12:42:04.790: E/AndroidRuntime(3073): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
01-17 12:42:04.790: E/AndroidRuntime(3073): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
01-17 12:42:04.790: E/AndroidRuntime(3073): at dalvik.system.NativeStart.main(Native Method)
01-17 12:42:04.790: E/AndroidRuntime(3073): Caused by: android.content.res.Resources$NotFoundException: File 296108030489520 from xml type layout resource ID #0x7f030001
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1934)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1889)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.Resources.getLayout(Resources.java:740)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-17 12:42:04.790: E/AndroidRuntime(3073): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:224)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.Activity.setContentView(Activity.java:1702)
01-17 12:42:04.790: E/AndroidRuntime(3073): at com.facebook.LoginActivity.onCreate(LoginActivity.java:55)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
01-17 12:42:04.790: E/AndroidRuntime(3073): ... 11 more
01-17 12:42:04.790: E/AndroidRuntime(3073): Caused by: java.io.FileNotFoundException: 296108030489520
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.AssetManager.openXmlAssetNative(Native Method)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:524)
01-17 12:42:04.790: E/AndroidRuntime(3073): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1916)
01-17 12:42:04.790: E/AndroidRuntime(3073): ... 20 more