1. Download our Official Android App: Forums for Android!

Android Studio - Virtual Machine Freezes or In Perpetual Loop

Discussion in 'Android Development' started by RewindJAA, Jun 13, 2018.

  1. RewindJAA

    RewindJAA Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jun 13, 2018

    Jun 13, 2018
    2
    0
    5
    I have installed Android Studio.

    When I Create a New Device I have to be careful.

    When I created a Nexus 5X 1080x1920 it does not allow me to change from Emulated Performance|Graphics|Automatic This kept on causing the virtual device to freeze or the emulator timing out before coming online.

    My machine is a Intel Pentium Quad Core 2.58GHz, Intel HD Graphics, 8GB DDR3 L Memory.

    Since I have just onboard graphics, I thought I would try for a lighter Virtual Device. I chose 5.1 WVGA API 27.

    This time I can change Emulated Performance|Graphics. When I have Automatic or Hardware it freezes again.

    Sometimes it repeatedly says:

    W/zygote: Attempt to remove non-JNI local reference, dumping thread​

    When I have it on Emulated Performance|Graphics|Software it goes in a perpetual loop trying to launch the machine or install the apk, but never succeeding.

    How can I get this to work?

    My Code:

    MainActivity.java

    Code (Java):
    1. package com.example.jon.testandroid;
    2.  
    3. import android.support.v7.app.AppCompatActivity;
    4. import android.os.Bundle;
    5. import android.webkit.WebChromeClient;
    6. import android.webkit.WebView;
    7. import android.widget.TextView;
    8.  
    9. public class MainActivity extends AppCompatActivity {
    10.  
    11.     // Used to load the 'native-lib' library on application startup.
    12.     static {
    13.         System.loadLibrary("native-lib");
    14.     }
    15.  
    16.     [USER=1021285]@override[/USER]
    17.     protected void onCreate(Bundle savedInstanceState) {
    18.         super.onCreate(savedInstanceState);
    19.         setContentView(R.layout.activity_main);
    20.  
    21.         // Example of a call to a native method
    22.         TextView tv = (TextView) findViewById(R.id.sample_text);
    23.         tv.setText(stringFromJNI());
    24.  
    25.         WebView webview = (WebView)findViewById(R.id.webView);
    26.         webview.getSettings().setJavaScriptEnabled(true);
    27.         webview.setWebChromeClient(new WebChromeClient());
    28.         webview.loadUrl("file:///android_asset/www/index.html");
    29.     }
    30.  
    31.     /**
    32.      * A native method that is implemented by the 'native-lib' native library,
    33.      * which is packaged with this application.
    34.      */
    35.     public native String stringFromJNI();
    36. }
    Android Manifest
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2.  
    3. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    4.  
    5.     package="com.example.jon.testandroid">
    6.  
    7.  
    8.     <uses-permission android:name="android.permission.INTERNET" />
    9.  
    10.  
    11.     <application
    12.  
    13.         android:allowBackup="true"
    14.  
    15.         android:icon="[USER=22138]@Mipmap[/USER]/ic_launcher"
    16.  
    17.         android:label="[USER=696546]@String[/USER]/app_name"
    18.  
    19.         android:roundIcon="[USER=22138]@Mipmap[/USER]/ic_launcher_round"
    20.  
    21.         android:supportsRtl="true"
    22.  
    23.         android:theme="[USER=19691]@Style[/USER]/AppTheme">
    24.  
    25.         <activity android:name=".MainActivity">
    26.  
    27.             <intent-filter>
    28.  
    29.                 <action android:name="android.intent.action.MAIN" />
    30.  
    31.  
    32.                 <category android:name="android.intent.category.LAUNCHER" />
    33.  
    34.             </intent-filter>
    35.  
    36.         </activity>
    37.  
    38.     </application>
    39.  
    40.  
    41. </manifest>
    index.html

    HTML:
    1. <!DOCTYPE html>
    2.  
    3.  
    4.  
    5.     <title>Page Title</title>
    6.  
    7. </head>
    8.  
    9.  
    10.  
    11. <h1>This is a Heading</h1>
    12.  
    13. <p id="id">This is a paragraph.</p>
    14.  
    15. <button onclick="alert('Hello')">Say Hello</button>
    16.  
    17.  
    18. </body>
    19.  
    20. </html>
     

    Advertisement

    #1 RewindJAA, Jun 13, 2018
    Last edited by a moderator: Jun 13, 2018
  2. Unforgiven

    Unforgiven OK Google
    Moderator
    Rank:
     #2
    Points:
    4,238
    Posts:
    35,576
    Joined:
    Jun 23, 2010

    Jun 23, 2010
    35,576
    39,947
    4,238
    Male
    Douglas, MA
    I added [code][/code] tags to make your post more readable. Good luck. :)
     
  3. RewindJAA

    RewindJAA Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jun 13, 2018

    Jun 13, 2018
    2
    0
    5
    Thanks for that.

    Yesterday it worked, it was great. I actually got loads of coding done.

    Then again today it has stopped working. Freezing, taking ages to come online. Same old problem.

    PLEASE HELP.

    Code (Text):
    1.  
    2.  
    3. 06/15 16:32:28: Launching app
    4. $ adb push C:\wamp64\www\TestAndroid\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.example.jon.testandroid
    5. $ adb shell pm install -t -r "/data/local/tmp/com.example.jon.testandroid"
    6. Success
    7.  
    8.  
    9. $ adb shell am start -n "com.example.jon.testandroid/com.example.jon.testandroid.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
    10. Client not ready yet..Waiting for process to come online
    11. Waiting for process to come online
    12. Connected to process 2821 on device emulator-5554
    13. Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
    14. D/EGL_emulation: eglCreateContext: 0xdad1f380: maj 2 min 0 rcv 2
    15. D/EGL_emulation: eglMakeCurrent: 0xdad1f380: ver 2 0 (tinfo 0xd9e13fc0)
    16. I/cr_LibraryLoader: Using linker: org.chromium.base.library_loader.ModernLinker
    17. W/cr_media: Requires BLUETOOTH permission
    18. D/OpenGLRenderer: HWUI GL Pipeline
    19. D/: HostConnection::get() New Host Connection established 0xc6b1c000, tid 2893
    20. I/zygote: Thread[3,tid=2827,WaitingInMainSignalCatcherLoop,Thread*=0xe3f2b800,peer=0x13cc0020,"Signal Catcher"]: reacting to signal 3
    21. I/zygote: Wrote stack traces to '[tombstoned]'
    22. D/EGL_emulation: eglCreateContext: 0xc630b2e0: maj 2 min 0 rcv 2
    23. I/OpenGLRenderer: Initialized EGL, version 1.4
    24. D/OpenGLRenderer: Swap behavior 1
    25. D/: HostConnection::get() New Host Connection established 0xc6308100, tid 2884
    26. W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
    27. D/OpenGLRenderer: Swap behavior 0
    28. D/EGL_emulation: eglCreateContext: 0xc6697220: maj 2 min 0 rcv 2
    29. D/EGL_emulation: eglMakeCurrent: 0xc630b2e0: ver 2 0 (tinfo 0xc64ff8c0)
    30. I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
    31. W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
    32. E/chromium: [ERROR:gl_surface_egl.cc(289)] eglChooseConfig failed with error EGL_SUCCESS
    33. D/EGL_emulation: eglMakeCurrent: 0xc6697220: ver 2 0 (tinfo 0xc66c4c70)
    34. I/Choreographer: Skipped 3093 frames!  The application may be doing too much work on its main thread.
    35. D/EGL_emulation: eglCreateContext: 0xc630a500: maj 2 min 0 rcv 2
    36. D/EGL_emulation: eglMakeCurrent: 0xc630a500: ver 2 0 (tinfo 0xc64ff8c0)
    37. W/zygote: Attempt to remove non-JNI local reference, dumping thread
    38. D/EGL_emulation: eglMakeCurrent: 0xc6697220: ver 2 0 (tinfo 0xc66c4c70)
    39.  
     
  4. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #17
    Points:
    1,488
    Posts:
    6,707
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    6,707
    9,424
    1,488
    Male
    Software developer
    South West of England
    A couple of things:

    What is your machine spec? Do you have enough RAM?

    Possibly a more drastic solution, but you may want to consider Linux as a development platform. I use it, and generally find it to be a more stable and performant development environment than Windows.
     
  5. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #17
    Points:
    1,488
    Posts:
    6,707
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    6,707
    9,424
    1,488
    Male
    Software developer
    South West of England
    Oh apologies, you already stated your hardware spec. Looks good enough to run everything.
     

Share This Page

Loading...