• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android Studio - Virtual Machine Freezes or In Perpetual Loop

RewindJAA

Newbie
Jun 13, 2018
27
6
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

Java:
package com.example.jon.testandroid;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

    // Used to load the 'native-lib' library on application startup.
    static {
        System.loadLibrary("native-lib");
    }

    [USER=1021285]@override[/USER]
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Example of a call to a native method
        TextView tv = (TextView) findViewById(R.id.sample_text);
        tv.setText(stringFromJNI());

        WebView webview = (WebView)findViewById(R.id.webView);
        webview.getSettings().setJavaScriptEnabled(true);
        webview.setWebChromeClient(new WebChromeClient());
        webview.loadUrl("file:///android_asset/www/index.html");
    }

    /**
     * A native method that is implemented by the 'native-lib' native library,
     * which is packaged with this application.
     */
    public native String stringFromJNI();
}
Android Manifest
Code:
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.example.jon.testandroid">


    <uses-permission android:name="android.permission.INTERNET" />


    <application

        android:allowBackup="true"

        android:icon="[USER=22138]@Mipmap[/USER]/ic_launcher"

        android:label="[USER=696546]@String[/USER]/app_name"

        android:roundIcon="[USER=22138]@Mipmap[/USER]/ic_launcher_round"

        android:supportsRtl="true"

        android:theme="[USER=19691]@Style[/USER]/AppTheme">

        <activity android:name=".MainActivity">

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />


                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

    </application>


</manifest>
index.html

HTML:
<!DOCTYPE html>

<html>

<head>

    <title>Page Title</title>

</head>

<body>


<h1>This is a Heading</h1>

<p id="id">This is a paragraph.</p>

<button onclick="alert('Hello')">Say Hello</button>


</body>

</html>
 
Last edited by a moderator:
I added [code][/code] tags to make your post more readable. Good luck. :)

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:
06/15 16:32:28: Launching app
$ adb push C:\wamp64\www\TestAndroid\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.example.jon.testandroid
$ adb shell pm install -t -r "/data/local/tmp/com.example.jon.testandroid"
Success


$ adb shell am start -n "com.example.jon.testandroid/com.example.jon.testandroid.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Connected to process 2821 on device emulator-5554
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/EGL_emulation: eglCreateContext: 0xdad1f380: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xdad1f380: ver 2 0 (tinfo 0xd9e13fc0)
I/cr_LibraryLoader: Using linker: org.chromium.base.library_loader.ModernLinker
W/cr_media: Requires BLUETOOTH permission
D/OpenGLRenderer: HWUI GL Pipeline
D/: HostConnection::get() New Host Connection established 0xc6b1c000, tid 2893
I/zygote: Thread[3,tid=2827,WaitingInMainSignalCatcherLoop,Thread*=0xe3f2b800,peer=0x13cc0020,"Signal Catcher"]: reacting to signal 3
I/zygote: Wrote stack traces to '[tombstoned]'
D/EGL_emulation: eglCreateContext: 0xc630b2e0: maj 2 min 0 rcv 2
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
D/: HostConnection::get() New Host Connection established 0xc6308100, tid 2884
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer: Swap behavior 0
D/EGL_emulation: eglCreateContext: 0xc6697220: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xc630b2e0: ver 2 0 (tinfo 0xc64ff8c0)
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
E/chromium: [ERROR:gl_surface_egl.cc(289)] eglChooseConfig failed with error EGL_SUCCESS
D/EGL_emulation: eglMakeCurrent: 0xc6697220: ver 2 0 (tinfo 0xc66c4c70)
I/Choreographer: Skipped 3093 frames!  The application may be doing too much work on its main thread.
D/EGL_emulation: eglCreateContext: 0xc630a500: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xc630a500: ver 2 0 (tinfo 0xc64ff8c0)
W/zygote: Attempt to remove non-JNI local reference, dumping thread
D/EGL_emulation: eglMakeCurrent: 0xc6697220: ver 2 0 (tinfo 0xc66c4c70)
 
Upvote 0
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.
 
  • Like
Reactions: KBU2
Upvote 0
I did not want to do a new boot on my machine with Linux as I am a bit tied to Windows at the moment.
I tried a VirtualBox virtual machine with Linux, but obviously came across the problem that you cannot have a virtual android machine within a virtualbox virtual machine.
Have reinstalled Android Studio multiple times and just cannot get it working again.
 
  • Like
Reactions: KBU2
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones