Java Question java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facepp/http/HttpRequests;

DonManfred

Expert
Licensed User
i´m writing a wrapper for face++ using the jar they provide.

the example shows the use of a HttpRequests wrapper
B4X:
Open Declaration com.facepp.http.HttpRequests
request to faceplusplus.com
new HttpRequests(apiKey, apiSecret).request("detection", "detect", postParameters)
new HttpRequests(apiKey, apiSecret).train()

Since:
1.0.0
Version:
1.2.0
B4X:
    new Thread(new Runnable() {
            public void run() {
                HttpRequests httpRequests = new HttpRequests("api_key", "api_secret");
The wrapper compiles fine with slc but when i want to use it in a b4a project i got the above error

I tried
B4X:
import com.facepp.http.*s;
import com.facepp.error.*;
import com.facepp.result.*;
and
B4X:
import com.facepp.http.HttpRequests;
import com.facepp.http.PostParameters;
import com.facepp.error.FaceppParseException;
import com.facepp.result.FaceppResult;
Everytime the same result.
 

DonManfred

Expert
Licensed User
B4X:
@DependsOn(values={"faceplusplus"})
LogCat connected to: 9f1dbeed
--------- beginning of crash


--------- beginning of system
--------- beginning of main


** Activity (main) Create, isFirst = true **


** Activity (main) Resume **
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facepp/http/HttpRequests;
at de.donmanfred.facepluspluswrapper$1.run(facepluspluswrapper.java:44)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facepp.http.HttpRequests" on path: DexPathList[[zip file "/data/app/b4a.example-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 2 more
Suppressed: java.lang.ClassNotFoundException: com.facepp.http.HttpRequests
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)


... 3 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
** Activity (main) Pause, UserClosed = true **
 
Top