Azure 移动应用程序:Android.get() 导致应用程序冻结
Azure Mobile App: Android .get() causes app to freeze
我有一个 class User
有几个属性和一个 String
叫 ID
所以它匹配我的数据库 table 叫 User
.目前我的 table User
是空的。
每当我尝试时:
mClient.getTable(User.class).insert(myUser).get();
或
mClient.getTable(User.class).execute().get();
我的应用程序在白屏上冻结,控制台未显示任何错误。我在 catch
子句中执行的 stackTrace 或打印从未显示。
我得到的唯一错误是:
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
这是我在 onCreate 方法中使用的代码:
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();
我是 azure 的新手,我找不到我朋友的任何帮助 google。提前致谢。
编辑:这是全部 logcat:
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30
t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
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
t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms
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
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms
t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
Azure Mobile App: Android .get() causes app to freeze
因为调用 .run()
作为方法而不是将 Runnable 传递给 Thread
。
创建 Thread
:
Runnable mRunnable=new Runnable()
{
// your code here
};
并将 mRunnable
对象传递给它:
Thread thread = new Thread(mRunnable);
thread.start();
我有一个 class User
有几个属性和一个 String
叫 ID
所以它匹配我的数据库 table 叫 User
.目前我的 table User
是空的。
每当我尝试时:
mClient.getTable(User.class).insert(myUser).get();
或
mClient.getTable(User.class).execute().get();
我的应用程序在白屏上冻结,控制台未显示任何错误。我在 catch
子句中执行的 stackTrace 或打印从未显示。
我得到的唯一错误是:
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
这是我在 onCreate 方法中使用的代码:
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();
我是 azure 的新手,我找不到我朋友的任何帮助 google。提前致谢。
编辑:这是全部 logcat:
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cee100, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/art: Suspending all threads took: 11.368ms
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xabea8b30
t2g.com.travel2gather I/Choreographer: Skipped 40 frames! The application may be doing too much work on its main thread.
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa2cc2220, error=EGL_SUCCESS
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa36a0480, error=EGL_SUCCESS
t2g.com.travel2gather E/Surface: getSlotFromBufferLocked: unknown buffer: 0xa2971570
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa227e720, error=EGL_SUCCESS
t2g.com.travel2gather W/art: Suspending all threads took: 10.473ms
t2g.com.travel2gather I/art: Not late-enabling -Xcheck:jni (already on)
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
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
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
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
t2g.com.travel2gather I/OpenGLRenderer: Initialized EGL, version 1.4
t2g.com.travel2gather W/EGL_emulation: eglSurfaceAttrib not implemented
t2g.com.travel2gather W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xa37d7c80, error=EGL_SUCCESS
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/data/t2g.com.travel2gather/lib
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
t2g.com.travel2gather W/art: Suspending all threads took: 5.557ms
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
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
t2g.com.travel2gather W/art: Suspending all threads took: 5.952ms
t2g.com.travel2gather W/art: Suspending all threads took: 6.214ms
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: System.exit called, status: 1
t2g.com.travel2gather I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather I/art: WaitForGcToComplete blocked for 5.428ms for cause Background
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
t2g.com.travel2gather W/System: ClassLoader referenced unknown path: /data/app/t2g.com.travel2gather-1/lib/x86
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
Azure Mobile App: Android .get() causes app to freeze
因为调用 .run()
作为方法而不是将 Runnable 传递给 Thread
。
创建 Thread
:
Runnable mRunnable=new Runnable()
{
// your code here
};
并将 mRunnable
对象传递给它:
Thread thread = new Thread(mRunnable);
thread.start();