Dliix Dliix - 5 months ago 265
Android Question

Azure Mobile App: Android .get() causes app to freeze

I have a class

User
that has several attributes and a
String
called
ID
so that it matches my DB table called
User
. At the moment my table
User
is empty.
Whenever I try:

mClient.getTable(User.class).insert(myUser).get();


or

mClient.getTable(User.class).execute().get();


My app freezes on a white screen and console shows no error. The stackTrace or prints that i do in my
catch
clause never show up.

The only errors I get are:

06-08 23:23:35.287 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86


Here is the code I use in my onCreate Method for :

User myUser = new User();
// fill in myUser's fields but Id.
new Runnable()
{
@Override
public void run() {
try {
User myUser2 = mClient.getTable(User.class).insert(myUser).get();
System.out.println("Successfully added the user !");
} catch (Exception e) {
e.printStackTrace();
}
}
}.run();


I am new to azure and I couldn't find any help with my friend google. Thanks in advance.

EDIT: Here is the whole logcat:

06-08 23:18:42.610 24385-24385/t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
06-08 23:18:42.887 24385-24385/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:18:45.103 24385-24385/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:19:21.053 24849-24849/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:19:21.253 24849-24855/t2g.com.travel2gather I/art: System.exit called, status: 1
06-08 23:19:21.253 24849-24855/t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
06-08 23:19:28.225 24915-24915/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:19:29.052 24915-24915/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:19:29.350 24915-24915/t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-08 23:19:29.590 24915-24962/t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

[ 06-08 23:19:29.602 24915:24915 D/ ]
HostConnection::get() New Host Connection established 0xabead140, tid 24915


[ 06-08 23:19:29.665 24915:24962 D/ ]
HostConnection::get() New Host Connection established 0xa313a110, tid 24962
06-08 23:19:29.675 24915-24962/t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
06-08 23:19:29.687 24915-24962/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:19:29.687 24915-24962/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS
06-08 23:21:23.872 26595-26595/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:21:24.875 26595-26595/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:21:25.254 26595-26595/t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-08 23:21:25.516 26595-26642/t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

[ 06-08 23:21:25.518 26595:26595 D/ ]
HostConnection::get() New Host Connection established 0xabead0c0, tid 26595


[ 06-08 23:21:25.587 26595:26642 D/ ]
HostConnection::get() New Host Connection established 0xa3134130, tid 26642
06-08 23:21:25.596 26595-26642/t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
06-08 23:21:25.608 26595-26642/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:21:25.608 26595-26642/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
06-08 23:22:01.296 26595-26633/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
06-08 23:22:01.733 26595-26605/t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms
06-08 23:22:02.044 26595-26642/t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30
06-08 23:22:02.057 26595-26595/t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
06-08 23:22:02.084 26595-26642/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:22:02.084 26595-26642/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
06-08 23:22:02.136 26595-26642/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:22:02.136 26595-26642/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS
06-08 23:22:03.375 26595-26642/t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570
06-08 23:22:09.915 26595-26633/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
06-08 23:22:09.985 26595-26642/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:22:09.985 26595-26642/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS
06-08 23:22:18.753 26595-26601/t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms
06-08 23:22:23.814 27456-27456/t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
06-08 23:22:23.901 27456-27456/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:22:24.662 27456-27456/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:22:25.122 27456-27456/t2g.com.travel2gather W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
06-08 23:22:25.209 27456-27466/t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 8584(1343KB) AllocSpace objects, 5(1600KB) LOS objects, 39% free, 3MB/6MB, paused 1.655ms total 226.868ms
06-08 23:22:25.362 27456-27508/t2g.com.travel2gather D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

[ 06-08 23:22:25.364 27456:27456 D/ ]
HostConnection::get() New Host Connection established 0xab6d42e0, tid 27456
06-08 23:22:25.372 27456-27498/t2g.com.travel2gather W/art: Verification of void com.squareup.okhttp.internal.http.HttpEngine.readResponse() took 169.113ms

[ 06-08 23:22:25.428 27456:27508 D/ ]
HostConnection::get() New Host Connection established 0xab6d48c0, tid 27508
06-08 23:22:25.437 27456-27508/t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
06-08 23:22:25.452 27456-27508/t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
06-08 23:22:25.452 27456-27508/t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS
06-08 23:22:25.770 27456-27498/t2g.com.travel2gather W/art: Verification of okio.Source com.squareup.okhttp.internal.http.HttpConnection.newChunkedSource(com.squareup.okhttp.internal.http.HttpEngine) took 157.042ms
06-08 23:23:22.067 27456-27497/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
06-08 23:23:22.548 27456-27466/t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 107958(3MB) AllocSpace objects, 1(240KB) LOS objects, 40% free, 4MB/6MB, paused 9.332ms total 199.896ms
06-08 23:23:22.620 27456-27466/t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms
06-08 23:23:22.658 27456-27466/t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 70224(2MB) AllocSpace objects, 6(364KB) LOS objects, 0% free, 7MB/7MB, paused 7.961ms total 76.058ms
06-08 23:23:22.746 27456-27466/t2g.com.travel2gather I/art: Background partial concurrent mark sweep GC freed 11587(629KB) AllocSpace objects, 5(2040KB) LOS objects, 39% free, 5MB/8MB, paused 5.417ms total 20.421ms
06-08 23:23:34.605 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:23:35.287 28469-28469/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:23:35.471 28469-28479/t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 14786(1156KB) AllocSpace objects, 1(20KB) LOS objects, 72% free, 1024KB/3MB, paused 19.184ms total 31.942ms
06-08 23:23:35.598 28469-28475/t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms
06-08 23:25:08.601 28469-28475/t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms
06-08 23:34:59.249 2508-2508/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:34:59.732 2508-2514/t2g.com.travel2gather I/art: System.exit called, status: 1
06-08 23:34:59.732 2508-2514/t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
06-08 23:35:16.849 2589-2589/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:35:17.258 2589-2589/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:35:17.509 2589-2600/t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background
06-08 23:35:30.928 2872-2872/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:35:31.059 2872-2872/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:38:04.099 2872-2883/t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 164(34KB) AllocSpace objects, 0(0B) LOS objects, 22% free, 666KB/856KB, paused 8.272ms total 38.306ms
06-08 23:40:19.208 4100-4100/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:40:19.565 4100-4100/t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
06-08 23:40:28.505 4100-4110/t2g.com.travel2gather I/art: Background sticky concurrent mark sweep GC freed 6278(406KB) AllocSpace objects, 0(0B) LOS objects, 13% free, 1497KB/1729KB, paused 5.499ms total 20.437ms

Answer

Azure Mobile App: Android .get() causes app to freeze

Because calling .run() as a method instead of passing Runnable to Thread.

Create a Thread:

Runnable mRunnable=new Runnable()
    {
     // your code here
    };

and pass mRunnable object to it:

Thread thread = new Thread(mRunnable);
thread.start();
Comments