我使用库egit-github
我使用gradle导入库
compile 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:3.7.0.201502260915-r'我尝试代码,就像上面链接中的readme.md中的示例一样。
GitHubClient client = new GitHubClient(); // this line throw exception
client.setCredentials("xxxxxx", "3xxxxxxx");但它会抛出异常,如下所示
07-02 21:08:28.620 30789-32145/com.example.quinn.githubknife E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-12108
Process: com.example.quinn.githubknife, PID: 30789
java.lang.VerifyError: org/eclipse/egit/github/core/client/GitHubClient
at com.example.quinn.githubknife.MainActivity$1$1.run(MainActivity.java:31)
at java.lang.Thread.run(Thread.java:841)我希望一些善良的人能帮助我。
发布于 2015-07-03 14:29:40
我只需将GSON添加到gradle文件中并修复这个problem.Because,egit库依赖于gson。
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:3.7.0.201502260915-r'https://stackoverflow.com/questions/31185717
复制相似问题