java - Error when trying to implement amazon mturk SDK into android studio project -
i trying implement amazon's mechanical turk android app. have followed instructions: http://docs.aws.amazon.com/awsmechturk/latest/awsmechanicalturkgettingstartedguide/creatingahit.html#java when specifying third party .jar files, gives me
error:gradle: execution failed task ':app:dexdebug'.
com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/library/java/javavirtualmachines/jdk1.7.0_79.jdk/contents/home/bin/java'' finished non-zero exit value 1
i have tried taking out every combination of .jar files , found out jaxrpc.jar file causing error. without file, error when running project is:
exception in thread "main" java.lang.noclassdeffounderror: javax/xml/rpc/serviceexception @ com.example.mturk.homeworkrequest.<init>(homeworkrequest.java:20) @ com.example.mturk.homeworkrequest.main(homeworkrequest.java:39) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ ...
where line 20 points to:
service = new requesterservice(new propertiesclientconfig("../mturk.properties"));
and line 39 points to:
homeworkrequest app = new homeworkrequest();
i have tried enabling multidex , looked around couldn't find solution. appreciated, have been stuck on problem few days now.
edit: here's code far. it's simple hit request similar sample in http://docs.aws.amazon.com/awsmechturk/latest/awsmechanicalturkgettingstartedguide/creatingahit.html#java
import com.amazonaws.mturk.requester.hit; import com.amazonaws.mturk.service.axis.requesterservice; import com.amazonaws.mturk.service.exception.serviceexception; import com.amazonaws.mturk.util.propertiesclientconfig; public class homeworkrequest{ private requesterservice service; private string title= "math question"; private string description = "solve math question shown"; private int numassignments = 3; private double reward = 0.05; public homeworkrequest(){ service = new requesterservice(new propertiesclientconfig("../mturk.properties")); } public void createhomeworkrequest(){ try { hit hit = service.createhit( title, description, reward, requesterservice.getbasicfreetextquestion( "can solve math question?"), numassignments); system.out.println("created hit: " + hit.gethitid()); system.out.println("hit location: "); system.out.println(service.getwebsiteurl() + "/mturk/preview?groupid=" + hit.gethittypeid()); } catch(serviceexception e) { system.err.println(e.getlocalizedmessage()); } } public static void main(string[] args){ homeworkrequest app = new homeworkrequest(); app.createhomeworkrequest(); } }
if @ step 1 of using mturk java sdk, need include sdk installation directory]\lib\third-party
in classpath
.
your inability find third-party jars such jaxb seems suggest ide facing issues finding necessary jars build.
please let know if still facing difficulties.
Comments
Post a Comment