Android facebook SDK doing error java.lang.NoClassDefFoundError‎

前端 未结 10 892
时光取名叫无心
时光取名叫无心 2020-12-09 05:57

I have just downloaded the facebook SDK from http://github.com/facebook/facebook-android-sdk I unpack it from git and opened Eclipse. I then created a new project using exis

10条回答
  •  暖寄归人
    2020-12-09 06:23

    I had similar problems. I am building one my lib project (with activities) and my main project using this lib. I had these problems. I had added the lib under the Project properties/Android section and at the bottom, as suggested correctly before, but this wasn't enough (note that both projects were compiling good). I had to change the lib project and use the full path to the layout as:

    setContentView(com.example.mylib.R.layout.activity_main1);
    

    Note that using just R.layout wasn't enough, although I have defined the:

    import com.example.mylib.R;
    

    Valid alternative is however:

    import com.example.mylib.R.layout;
    setContentView(layout.activity_main1);
    

    Using Eclipse.

    hth to someone

提交回复
热议问题