3

I am learning xml and this is all the 'code' my app executes when I run it.When I hit run in android studio and I get the following message unfortunately 'my app has suddenly stopped' accompanied by the following error messages in the event log,

  1. Emulator: Warning: QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/1000/snap.android-studio', please create it with 0700 permissions. ((null):0, (null))
  2. Emulator: pc_memory_init: above 4g size: 40000000

I have tried running the app on diferent virtual devices as well as my own android device.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools">

    <TextView
        android:id="@+id/happy_birthday"
        android:text="@string/birthday"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="30sp"/>

    <TextView
        android:id="@+id/dear_ian"
        android:layout_width="291dp"
        android:layout_height="wrap_content"
        android:layout_below="@id/happy_birthday"
        android:layout_marginStart="-127dp"
        android:layout_marginTop="3dp"
        android:layout_toEndOf="@id/happy_birthday"
        android:text="@string/ian"
        android:textSize="30sp" />


    <ImageView
        android:src="@drawable/download"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        tools:ignore="ContentDescription"/>

    <TextView
        android:id="@+id/from_dennis"
        android:text="@string/dennis"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:textSize="30sp"/>

app should run but it does not

EdChum
  • 376,765
  • 198
  • 813
  • 562
Dennis
  • 83
  • 1
  • 9
  • Please [edit] your question to provide a [mcve] that demonstrates the issue, as well as the complete [stack trace from the crash](https://stackoverflow.com/a/23353174). – Mike M. May 02 '19 at 23:12

3 Answers3

3

Your application is not working not because of this. What is written in the log is only a warning. You can correct this warning by creating the necessary folder. To do this, write in the terminal linux:

mkdir /run/user/1000/snap.android-studio
2

I stopped getting the Emulator: pc_memory_init: above 4g size: 40000000 error after decreasing the RAM on the AVD below 4G:

  1. From the main menu, click: Tools > AVD Manager
  2. Click the pencil icon (Edit this AVD) under Actions for the target Virtual Device.
  3. Click Show Advanced Settings
  4. Set RAM to a value less than 4G (for instance, 3072MB)
  5. Click Finish, then Run your app!
Design.Garden
  • 3,607
  • 25
  • 21
0

Try:

  • From file menu: Invalidate cache and restart
  • Increase Android Studio memory limit
  • Run as Administrator

Also try posting the logcat / MainClass

Teodor Radu
  • 113
  • 1
  • 1
  • 9