Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 很奇怪,安卓应用程序在插入任何20欧元纸币的图片时崩溃_Android_Image_Background_Crash - Fatal编程技术网

Android 很奇怪,安卓应用程序在插入任何20欧元纸币的图片时崩溃

Android 很奇怪,安卓应用程序在插入任何20欧元纸币的图片时崩溃,android,image,background,crash,Android,Image,Background,Crash,我正在开发一个应用程序,允许用户向慈善机构捐款,目前,每个金额的按钮都会显示纸币/硬币的图片。真正奇怪的是,每当一张20欧元纸币的图像被显示出来并且有背景图像时,它就会崩溃。没有背景图像,效果很好。我尝试过截屏图片,并用它来防止文件损坏,使用不同的图片,尝试不同的格式。总是一张20欧元的钞票会引起问题,我可以有5个10欧元的钞票按钮,一切正常。另外,我尝试过的20欧元纸币的图像尺寸和大小都与其他工作按钮相同 <android.support.constraint.ConstraintLay

我正在开发一个应用程序,允许用户向慈善机构捐款,目前,每个金额的按钮都会显示纸币/硬币的图片。真正奇怪的是,每当一张20欧元纸币的图像被显示出来并且有背景图像时,它就会崩溃。没有背景图像,效果很好。我尝试过截屏图片,并用它来防止文件损坏,使用不同的图片,尝试不同的格式。总是一张20欧元的钞票会引起问题,我可以有5个10欧元的钞票按钮,一切正常。另外,我尝试过的20欧元纸币的图像尺寸和大小都与其他工作按钮相同

<android.support.constraint.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="ie.jc.dare3.temp">

<ImageButton
    android:id="@+id/fiftyCent"
    android:layout_width="94dp"
    android:layout_height="94dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/fifty_cent"
    app:layout_constraintTop_toTopOf="parent"
    android:layout_marginTop="16dp"
    android:layout_marginLeft="16dp"
    app:layout_constraintLeft_toLeftOf="parent" />
<ImageButton
    android:id="@+id/oneEuro"
    android:layout_width="94dp"
    android:layout_height="94dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/one_euro"
    app:layout_constraintTop_toTopOf="parent"
    android:layout_marginTop="16dp"
    app:layout_constraintRight_toLeftOf="@+id/twoEuro"
    android:layout_marginRight="8dp"
    app:layout_constraintLeft_toRightOf="@+id/fiftyCent"
    android:layout_marginLeft="8dp"
    app:layout_constraintHorizontal_bias="0.564" />
<ImageButton
    android:id="@+id/twoEuro"
    android:layout_width="94dp"
    android:layout_height="94dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/two_euro"
    app:layout_constraintTop_toTopOf="parent"
    android:layout_marginTop="16dp"
    android:layout_marginRight="16dp"
    app:layout_constraintRight_toRightOf="parent" />

<ImageButton
    android:id="@+id/twentyEuro"
    android:layout_width="171dp"
    android:layout_height="107dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/twenty"
    android:layout_marginTop="8dp"
    app:layout_constraintTop_toBottomOf="@+id/tenEuro"
    android:layout_marginLeft="8dp"
    app:layout_constraintLeft_toLeftOf="parent"
    android:layout_marginRight="8dp"
    app:layout_constraintRight_toRightOf="parent" />
<ImageButton
    android:id="@+id/tenEuro"
    android:layout_width="171dp"
    android:layout_height="107dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/ten_euro"
    android:layout_marginTop="8dp"
    app:layout_constraintTop_toBottomOf="@+id/fiveEuro"
    android:layout_marginRight="8dp"
    app:layout_constraintRight_toRightOf="parent"
    android:layout_marginLeft="8dp"
    app:layout_constraintLeft_toLeftOf="parent" />
<ImageButton
    android:id="@+id/fiveEuro"
    android:layout_width="171dp"
    android:layout_height="107dp"
    android:backgroundTint="@android:color/transparent"
    android:scaleType="fitXY"
    app:srcCompat="@drawable/five_euro"
    android:layout_marginLeft="8dp"
    app:layout_constraintLeft_toLeftOf="parent"
    android:layout_marginRight="8dp"
    app:layout_constraintRight_toRightOf="parent"
    android:layout_marginTop="28dp"
    app:layout_constraintTop_toBottomOf="@+id/oneEuro"
    app:layout_constraintHorizontal_bias="0.502" />


我没有安卓系统的经验,所以我想加上这句话作为评论——但我没有足够的声誉,所以

我可能选择了完全错误的树,但我注意到,对于xml中的一个属性,您有:

app:srcCompat="@drawable/twenty"
它不同于所有其他标记,其中它有下划线和单位,例如

 app:srcCompat="@drawable/five_euro"

所以,也许你只是有一个打字错误,引用了一些不存在的东西?

你使用的每幅图像的分辨率是多少?有两种尺寸;286x150(用于便笺和制作应用程序崩溃的图像所使用的便笺)和150x150(用于硬币)。感谢您的建议,但这实际上是我尝试各种可能的组合时留下的一个人工制品,包括将其从20欧元改为20欧元,因为我使用了一个新图像。