简体   繁体   中英

java.lang.noClassDefFoundError: Failed resolution of: Lcom/facebook/R$style;

I try to add the facebook sdk to my delphi android project. I add to the libraries the file facebook-android-sdk.jar, however when i run the app and try to launch for exemple :

package com.wrapper.facebook;

import com.facebook.share.widget.AppInviteDialog;

public class FaceBookAppInvite {

  public static boolean canShow() {
      return AppInviteDialog.canShow();
  }

}

when i call from delphi canShow i receive the error: java.lang.noClassDefFoundError: Failed resolution of: Lcom/facebook/R$style;

what did i miss ? where to find and how to add R$style ?

Android development tools will generate [your package].R.java from your android project resources when you compile your project.

And then some resources would be parts of inner class of R class.

I think you know this well.

After looking your question, the Lcom/facebook/R$style may be the R class generate from facebook sdk resource.

but i have no any experience of using facebook sdk, however i have some sugestion for you:

1.Decompile the facebook-android-sdk.jar. Make sure that there is no any R class in it.

2.Read the facebook sdk tutorial again.Try to find out which stup you have miss.

3.What kind of ide do you use? may be your project output apk does not include any facebook sdk, because your ide compile script does not output sdk with your codes.so check it out.

4.Do you have more runtime log?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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