我想在Android上学习Microsoft Emotion API。
所以,我尝试运行Android SDK示例。 (https://github.com/Microsoft/Cognitive-emotion-android)
但是,当我选择一张照片时,结果场景会出现崩溃并退出。
这是日志。
11-21 14:23:39.643 6245-6290/com.emotion.emotionapi E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.emotion.emotionapi, PID: 6245
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/io/IOUtils;
at com.microsoft.projectoxford.emotion.EmotionServiceRestClient.recognizeImage(EmotionServiceRestClient.java:105)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity.processWithFaceRectangles(RecognizeActivity.java:224)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity.access$000(RecognizeActivity.java:67)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity$doRequest.doInBackground(RecognizeActivity.java:257)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity$doRequest.doInBackground(RecognizeActivity.java:236)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didnt find class "org.apache.commons.io.IOUtils" on path: DexPathList[[zip file "/data/app/com.emotion.emotionapi-1/base.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.emotion.emotionapi-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.emotion.emotionapi-1/lib/x86_64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.microsoft.projectoxford.emotion.EmotionServiceRestClient.recognizeImage(EmotionServiceRestClient.java:105)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity.processWithFaceRectangles(RecognizeActivity.java:224)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity.access$000(RecognizeActivity.java:67)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity$doRequest.doInBackground(RecognizeActivity.java:257)
at com.microsoft.projectoxford.emotionsample.RecognizeActivity$doRequest.doInBackground(RecognizeActivity.java:236)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Suppressed: java.lang.ClassNotFoundException: org.apache.commons.io.IOUtils
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 12 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
这是第224行
result = this.client.recognizeImage(inputStream, faceRectangles);
我该如何解决?