Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Error Could not find method android.opengl.GLSurfaceView.setPreserveEGLContext OnPause

Discussion in 'Editor & General Support' started by Kazowatti, Aug 6, 2013.

  1. Kazowatti

    Kazowatti

    Joined:
    Aug 6, 2013
    Posts:
    3
    My game runs with no issues in several android devices, from 2.1 to 4.x versions, but when using Prime31 SocialNetwork plugin, some devices stop working after I run Init() function (to initialize Facebook). Prime support suggest that is a Unity problem:

    "Are you running this on an actual device? If so, there are some serious issues in there. The log indicates that tons of standard Android methods are missing:
    Could not find method android.view.Display.getRealMetrics
    Could not find method android.opengl.GLSurfaceView.setPreserveEGLContextOnPause
    Could not find method android.util.Base64.encodeToString
    If this happens on an actual device be sure to send a bug report over to Unity.
    I'm not sure there is anything we can even suggest for something like that. Unity won't be able to operate if it cant get the display metrics or pause it's OpenGL view.
    Please do report back when Unity gets back to you. I am extremely curious how and why something like that can even happen"

    My logcat is below. Thanks in advance.

    08-03 09:39:51.092 1634 1634 D dalvikvm: GC freed 2709 objects / 113072 bytes in 70ms
    08-03 09:39:56.092 1487 1487 D dalvikvm: GC freed 2167 objects / 95512 bytes in 66ms
    08-03 09:39:58.186 1318 1318 D dalvikvm: GC freed 325 objects / 17080 bytes in 64ms
    08-03 09:40:01.132 1260 1285 I ActivityManager: Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10100000 cmp=com.unity3d.player/.UnityPlayerProxyActivity }
    08-03 09:40:01.194 1260 1351 I ActivityManager: Start proc com.unity3d.player for activity com.unity3d.player/.UnityPlayerProxyActivity: pid=6251 uid=10083 gids={3003}
    08-03 09:40:01.303 1121 1121 D dalvikvm: GC freed 301 objects / 11464 bytes in 118ms
    08-03 09:40:01.311 6251 6251 I dalvikvm: Debugger thread not active, ignoring DDM send (t=0x41504e4d l=38)
    08-03 09:40:01.342 6251 6251 I dalvikvm: Debugger thread not active, ignoring DDM send (t=0x41504e4d l=40)
    08-03 09:40:01.428 1260 5005 I ActivityManager: Starting activity: Intent { flg=0x10000 cmp=com.unity3d.player/.UnityPlayerActivity }
    08-03 09:40:01.475 1121 1121 D dalvikvm: GC freed 57 objects / 2624 bytes in 109ms
    08-03 09:40:01.483 6251 6251 I dalvikvm: Could not find method android.opengl.GLSurfaceView.setPreserveEGLContextOnPause, referenced from method com.unity3d.player.UnityPlayer.a
    08-03 09:40:01.483 6251 6251 W dalvikvm: VFY: unable to resolve virtual method 393: Landroid/opengl/GLSurfaceView;.setPreserveEGLContextOnPause (Z)V
    08-03 09:40:01.483 6251 6251 D dalvikvm: VFY: replacing opcode 0x6e at 0x0071
    08-03 09:40:01.483 6251 6251 D dalvikvm: Making a copy of Lcom/unity3d/player/UnityPlayer;.a code (528 bytes)
    08-03 09:40:01.507 6251 6251 I dalvikvm: Could not find method android.view.Display.getRealMetrics, referenced from method com.unity3d.player.UnityPlayer.getDisplaySize
    08-03 09:40:01.507 6251 6251 W dalvikvm: VFY: unable to resolve virtual method 2469: Landroid/view/Display;.getRealMetrics (Landroid/util/DisplayMetrics;)V
    08-03 09:40:01.507 6251 6251 D dalvikvm: VFY: replacing opcode 0x6e at 0x005e
    08-03 09:40:01.507 6251 6251 D dalvikvm: Making a copy of Lcom/unity3d/player/UnityPlayer;.getDisplaySize code (249 bytes)
    08-03 09:40:01.577 1121 1121 D dalvikvm: GC freed 2 objects / 48 bytes in 96ms
    08-03 09:40:01.577 6251 6251 D dalvikvm: Trying to load lib /data/data/com.unity3d.player/lib/libmono.so 0x455a0150
    08-03 09:40:01.593 6251 6251 D dalvikvm: Added shared lib /data/data/com.unity3d.player/lib/libmono.so 0x455a0150
    08-03 09:40:01.827 6251 6251 D dalvikvm: Trying to load lib /data/data/com.unity3d.player/lib/libunity.so 0x455a0150
    08-03 09:40:01.827 6251 6251 D dalvikvm: Added shared lib /data/data/com.unity3d.player/lib/libunity.so 0x455a0150
    08-03 09:40:02.663 1260 5005 D dalvikvm: GC freed 40816 objects / 1910592 bytes in 135ms
    08-03 09:40:02.725 6251 6256 D Unity : Creating OpenGL ES 2.0 context (RGB16 565 24/8)
    08-03 09:40:02.796 1260 1283 I ActivityManager: Displayed activity com.unity3d.player/.UnityPlayerActivity: 1359 ms (total 1610 ms)
    08-03 09:40:07.897 1366 1366 D dalvikvm: GC freed 1564 objects / 59144 bytes in 100ms
    08-03 09:40:09.303 6251 6256 I dalvikvm: Could not find method android.util.Base64.encodeToString, referenced from method com.prime31.FacebookPlugin.printKeyHash
    08-03 09:40:09.303 6251 6256 W dalvikvm: VFY: unable to resolve static method 2451: Landroid/util/Base64;.encodeToString ([BI)Ljava/lang/String;
    08-03 09:40:09.303 6251 6256 D dalvikvm: VFY: replacing opcode 0x71 at 0x003e
    08-03 09:40:09.303 6251 6256 D dalvikvm: Making a copy of Lcom/prime31/FacebookPlugin;.printKeyHash code (206 bytes)
    08-03 09:40:09.444 6251 6256 D dalvikvm: GC freed 4150 objects / 343152 bytes in 42ms
    08-03 09:40:09.600 6251 6256 W dalvikvm: threadid=13: thread exiting with uncaught exception (group=0x4001e2e0)
    08-03 09:40:09.608 6251 6253 I dalvikvm: threadid=7: reacting to signal 3
    08-03 09:40:09.616 6251 6253 I dalvikvm: Wrote stack trace to '/data/anr/traces.txt'
    08-03 09:40:12.889 1738 1738 D dalvikvm: GC freed 427 objects / 288488 bytes in 90ms
    08-03 09:40:15.311 1260 1427 I ActivityManager: Process com.unity3d.player (pid 6251) has died.
    08-03 09:40:20.600 1429 1429 D dalvikvm: GC freed 174 objects / 6632 bytes in 78ms