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

Emulator won't display my Hello World app

I can't find a solution to the emulator giving the following error message.
Code:
Executing tasks: [:app:assembleDebug]

7:25 AM    Emulator: dsound:

7:25 AM    Emulator: Could not initialize DirectSoundCapture

7:25 AM    Emulator: dsound: Reason: No sound

7:25 AM    Emulator: driver is available for use, or the given GUID is not a valid DirectSound device ID

7:25 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

7:25 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

7:25 AM    Emulator: audio: Failed to create voice `goldfish_audio_in'

7:25 AM    Emulator: C:\Users\Shelby\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-i386.exe: warning: opening audio input failed

7:25 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

7:25 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

7:25 AM    Emulator: audio: Failed to create voice `adc'

Can someone point me in the right direction for my solution?

I have tried a setting change on my Windows 10 and within the AVD manager box. I'm still searching google and can't find a remedy.

Thanks
Newbie Shelby with 1 year of B4A experience
 
Last edited:
Thanks Sugar,
6
So far it didn't work but I'll leave the code as you suggested for now. I had seen the stackoverflow thread, but only now got around to changing the code as you mentioned. By the way, I never had the resources tags and related lines but I added them to no avail. I still get errors:

Code:
Emulator: dsound: Could not initialize DirectSoundCapture

6:59 AM    Emulator: dsound: Reason: No sound driver is available for use, or the given GUID is not a valid DirectSound device ID

6:59 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:59 AM    Emulator: dsound: Attempt to initialize voice without DirectSoundCapture object

6:59 AM    Emulator: audio: Failed to create voice `goldfish_audio_in'

6:59 AM    Emulator: C:\Users\S
 
Last edited:
Since I never seemed to notice any benefit from adding the resources tags and related code, I have removed them. Still I have no ability to bring up my app on the emulator.
Here's my code before removing the resources code: (activity_main.xml)

Code:
<?xml version="1.0" encoding="utf-8"?>

<resources>
    <item name="workouttype" type="id" />
    <item name="txthello" type="id"/>
</resources>

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <EditText
        android:id="@+id/editTextFirstName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="First Name"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <EditText
        android:id="@+id/editTextLastName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Last Name"
        app:layout_constraintStart_toStartOf="@+id/editTextFirstName"
        app:layout_constraintTop_toBottomOf="@+id/editTextFirstName" />

    <EditText
        android:id="@+id/editTextEmail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:ems="10"
        android:inputType="textPersonName"
        android:text="Email"
        app:layout_constraintEnd_toEndOf="@+id/editTextLastName"
        app:layout_constraintStart_toStartOf="@+id/editTextLastName"
        app:layout_constraintTop_toBottomOf="@+id/editTextLastName" />

    <Button
        android:id="@+id/btnRegister"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="Register"
        app:layout_constraintEnd_toEndOf="@+id/editTextEmail"
        app:layout_constraintStart_toStartOf="@+id/editTextEmail"
        app:layout_constraintTop_toBottomOf="@+id/editTextEmail" />

    <TextView
        android:id="@+id/textViewFirstName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="100dp"
        android:text="First Name"
        app:layout_constraintEnd_toEndOf="@+id/btnRegister"
        app:layout_constraintStart_toStartOf="@+id/btnRegister"
        app:layout_constraintTop_toBottomOf="@+id/btnRegister" />

    <TextView
        android:id="@+id/textViewLastName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:text="Last Name"
        app:layout_constraintEnd_toEndOf="@+id/textViewFirstName"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="@+id/textViewFirstName"
        app:layout_constraintTop_toBottomOf="@+id/textViewFirstName" />

    <TextView
        android:id="@+id/textViewEmail"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="24dp"
        android:text="Email"
        app:layout_constraintEnd_toEndOf="@+id/textViewLastName"
        app:layout_constraintStart_toStartOf="@+id/textViewLastName"
        app:layout_constraintTop_toBottomOf="@+id/textViewLastName" />
</androidx.constraintlayout.widget.ConstraintLayout>
 
Back
Top Bottom