我正在尝试将我的Android应用程序与Singly集成,但我得到NoClassDefFoundError
StringUtils
,由SinglyClient使用。我很确定这是我配置构建路径或为Facebook和Singly设置SDK的方式的问题。这基本上就是我的设置:
目录结构:
parent-dir/
MyApp/
MyTestApp/
facebook-android-sdk/
singly-android-sdk/
facebook-android-sdk
实际上是Github repo中的目录facebook-android-sdk/facebook
,singly-android-sdk
实际上是Github repo中的目录singly-android/sdk
。所有这些都已导入Eclipse中的工作区,但未复制。根据说明here,Facebook SDK是通过Android -> Existing code...
导入的,而Singly SDK是通过General -> Existing projects...
Facebook SDK配置
Android:
✓ Is Library
Java Build Path:
Source:
FacebookSDK/gen
FacebookSDK/src
Libraries/Android Private Libraries:
android-support-v4.jar
单一SDK配置
Android:
✓ Is Library
+-------------------------+-------------+
| Reference | Project |
+-------------------------+-------------+
| ../facebook-android-sdk | FacebookSDK |
+-------------------------+-------------+
Java Build Path:
Source:
SinglyAndroidSDK/gen
SinglyAndroidSDK/src
Libraries:
Android Dependencies:
facebooksdk.jar - /path/to/facebook-android-sdk/bin
Android Private Libraries:
< Big collection of jars here - will call this SinglyJarCollection>
Project References:
✓ Facebook SDK
MyApp配置
Android:
+-----------------------+------------------+
| Reference | Project |
+-----------------------+------------------+
| ../singly-android-sdk | SinglyAndroidSDK |
+-----------------------+------------------+
Java Build Path:
Source:
MyApp/gen
MyApp/src
Libraries:
<SinglyJarCollection>
Android Dependencies:
singlyandroidsdk.jar - /path/to/singly-android-sdk/bin
facebooksdk.jar - /path/to/facebook-android-sdk/bin
Android Private Libraries:
<Some jars on which my application depends>
我不知道我在这个设置中做错了什么,但Eclipse报告没有语法错误,我的.apk文件安装得很好并且有效。但是,当我单击“登录”按钮时,我配置为调用SinglyClient的authenticate
方法,我得到NoClassDefFoundError
的{{1}}问题,该问题位于其中一个jar文件中取决于。