在android studio中找不到类

时间:2016-05-04 02:53:40

标签: java android eclipse android-studio soap

我从eclipse导入我的投影到android工作室它工作正常,在Android工作室它可以在模拟器中工作但在真实设备中

这是log

  

05-04 08:14:14.989 8986-9070 / com.rcmbusiness E / AndroidRuntime:FATAL   EXCEPTION:AsyncTask#1                                                                  过程:com.rcmbusiness,PID:8986                                                                  java.lang.RuntimeException:执行时发生错误   doInBackground()                                                                      在android.os.AsyncTask $ 3.done(AsyncTask.java:300)                                                                      在java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)                                                                      at java.util.concurrent.FutureTask.setException(FutureTask.java:222)                                                                      在java.util.concurrent.FutureTask.run(FutureTask.java:242)                                                                      在android.os.AsyncTask $ SerialExecutor $ 1.run(AsyncTask.java:231)                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)                                                                      at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587)                                                                      在java.lang.Thread.run(Thread.java:841)                                                                   引起:java.lang.NoClassDefFoundError:   org.ksoap2.serialization.SoapObject                                                                      在com.rcmbusiness.utility.APIRequest.doInBackground(APIRequest.java:113)                                                                      在com.rcmbusiness.utility.APIRequest.doInBackground(APIRequest.java:29)                                                                      在android.os.AsyncTask $ 2.call(AsyncTask.java:288)                                                                      在java.util.concurrent.FutureTask.run(FutureTask.java:237)                                                                      在android.os.AsyncTask $ SerialExecutor $ 1.run(AsyncTask.java:231)                                                                      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)                                                                      at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:587)                                                                      在java.lang.Thread.run(Thread.java:841)

摇篮

 compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.google.code.gson:gson:2.2.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.github.bumptech.glide:glide:3.6.1'


compile files('libs/AndroidAnimations.jar')
compile files('libs/AndroidEasingFunctions-1.0.0.jar')
compile files('libs/gcm.jar')

compile files('libs/ksoap2-android-assembly-3.0.0-jar-with-       dependencies.jar')

1 个答案:

答案 0 :(得分:0)

首先,您应该删除项目结构中的ksoap并执行以下步骤。 我有同样的问题,这是适合我的方式。 1st:在app / libs中创建文件夹库。 第二步:将ksoap.jar复制到此文件夹。 第3步:右键单击Jar文件,然后选择添加为库。 然后,正常导入ksoap2。