我执行我的Android应用程序,正确编译,当我尝试访问某些SoundCloud API时,它崩溃了。以下是Logcat
logcat的
E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: de.voidplus.soundcloud.SoundCloud
at it.polimi.dima.sound4u.activity.FirstAccessActivity$LoginTask.onPreExecute(FirstAccessActivity.java:75)
at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:586)
at android.os.AsyncTask.execute(AsyncTask.java:534)
at it.polimi.dima.sound4u.activity.FirstAccessActivity.doLogin(FirstAccessActivity.java:56)
at it.polimi.dima.sound4u.fragment.FirstAccessFragment$1.onClick(FirstAccessFragment.java:76)
at android.view.View.performClick(View.java:4240)
at android.view.View$PerformClick.run(View.java:17721)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
这是我的gradle.build
文件。
gradle.build
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.1+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
}
dependencies {
compile 'com.android.support:support-v4:19.0.0'
compile 'com.android.support:appcompat-v7:19.0.0'
compile 'com.google.api-client:google-api-client:1.17.0-rc'
compile 'com.google.api-client:google-api-client-android:1.17.0-rc'
compile 'com.google.http-client:google-http-client:1.17.0-rc'
compile 'com.google.http-client:google-http-client-android:1.17.0-rc'
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile 'com.google.oauth-client:google-oauth-client:1.17.0-rc'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.guava:guava-jdk5:14.0.1'
compile 'com.google.code.findbugs:jsr305:2.0.3'
compile 'com.eclipsesource.minimal-json:minimal-json:0.9.1'
compile files('libs/sound4uendpoints-v1-1.17.0-rc-SNAPSHOT.jar')
compile files('libs/soundscoud-unoff.jar')
}
如您所见,我有很多外部依赖项,soundscoud-unoff.jar
负责崩溃。看来这个库不在应用程序的构建路径中。我使用IntelliJ Idea,有人可以解决这个问题吗?