Have there been any recent changes to the orders SDK? We are having all sorts of issues using the OrderConnector, with code that was working before.
I thought maybe it was an issue with my build (e.g. libraries being updated), so I downloaded an old release from the sandbox, which was working and QAed before, but now that has the same error:
03-22 17:09:24.497 21399 21415 E Parcel : Class not found when unmarshalling: com.clover.sdk.v3.order.Order 03-22 17:09:24.497 21399 21415 E Parcel : java.lang.ClassNotFoundException: com.clover.sdk.v3.order.Order 03-22 17:09:24.497 21399 21415 E Parcel : at java.lang.Class.classForName(Native Method) 03-22 17:09:24.497 21399 21415 E Parcel : at java.lang.Class.forName(Class.java:400) 03-22 17:09:24.497 21399 21415 E Parcel : at android.os.Parcel.readParcelableCreator(Parcel.java:2508) 03-22 17:09:24.497 21399 21415 E Parcel : at android.os.Parcel.readParcelable(Parcel.java:2462) 03-22 17:09:24.497 21399 21415 E Parcel : at android.os.Parcel.readValue(Parcel.java:2365) 03-22 17:09:24.497 21399 21415 E Parcel : at d.b.b.m.g.k$a.a(:3) 03-22 17:09:24.497 21399 21415 E Parcel : at d.b.b.l.f.c(:6) 03-22 17:09:24.497 21399 21415 E Parcel : at d.b.b.m.g.k.i() 03-22 17:09:24.497 21399 21415 E Parcel : at e.a.a.a.doInBackground(:3) 03-22 17:09:24.497 21399 21415 E Parcel : at android.os.AsyncTask$2.call(AsyncTask.java:305) 03-22 17:09:24.497 21399 21415 E Parcel : at java.util.concurrent.FutureTask.run(FutureTask.java:237) 03-22 17:09:24.497 21399 21415 E Parcel : at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 03-22 17:09:24.497 21399 21415 E Parcel : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 03-22 17:09:24.497 21399 21415 E Parcel : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 03-22 17:09:24.497 21399 21415 E Parcel : at java.lang.Thread.run(Thread.java:761) 03-22 17:09:24.497 21399 21415 E Parcel : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.clover.sdk.v3.order.Order" on path: DexPathList[[zip file "/data/app/snip/base.apk"],nativeLibraryDirectories=[/data/app/<snip>/lib/x86, /data/app/snip/base.apk!/lib/x86, /system/lib, /vendor/lib]] 03-22 17:09:24.497 21399 21415 E Parcel : at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 03-22 17:09:24.497 21399 21415 E Parcel : at java.lang.ClassLoader.loadClass(ClassLoader.java:380) 03-22 17:09:24.497 21399 21415 E Parcel : at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 03-22 17:09:24.497 21399 21415 E Parcel : ... 15 more
This only occurs in release builds, in debug builds the code works perfectly. I've created a concise example that reproduces the error - it works in debug builds, but in release builds it crashes when trying to create the order:
package mycomp.services; import android.app.IntentService; import android.content.Intent; import android.os.RemoteException; import android.util.Log; import com.clover.sdk.util.CloverAccount; import com.clover.sdk.v1.BindingException; import com.clover.sdk.v1.ClientException; import com.clover.sdk.v1.ServiceException; import com.clover.sdk.v3.order.Order; import com.clover.sdk.v3.order.OrderConnector; public class OrderCreateTestService extends IntentService { final String TAG = "OrderCreateTestService"; public OrderCreateTestService() { super(OrderCreateTestService.class.getName()); } protected OrderConnector orderConnector; @Override public void onCreate() { super.onCreate(); orderConnector = new OrderConnector(this, CloverAccount.getAccount(this), null); orderConnector.connect(); } @Override public void onDestroy() { if (orderConnector != null) { orderConnector.disconnect(); orderConnector = null; } super.onDestroy(); } @Override protected void onHandleIntent(Intent intent) { try { orderConnector.createOrder( new Order() .setTitle("Test Order #1234") .setNote("This is a test order.") ); } catch (RemoteException | ClientException | ServiceException | BindingException e) { Log.e(TAG, "Error creating order: " + e.getMessage()); e.printStackTrace(); } } }