I got the following error when building:
FATAL EXCEPTION: main
Process: com.example.materialcomponentsmotion, PID: 15554
android.view.InflateException: Binary XML file line #63 in com.example.materialcomponentsmotion:layout/fragment_email: Binary XML file line #63 in com.example.materialcomponentsmotion:layout/fragment_email: Error inflating class ImageButton
Caused by: android.view.InflateException: Binary XML file line #63 in com.example.materialcomponentsmotion:layout/fragment_email: Error inflating class ImageButton
Caused by: java.lang.NumberFormatException: For input string: "?2130969008"
at jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
at jdk.internal.math.FloatingDecimal.parseFloat(FloatingDecimal.java:122)
.
.
.
As you can see, there is a problem in line 63
.
fragment_email.xml
<ImageButton
android:id="@+id/navigation_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/grid_2"
app:layout_constraintEnd_toEndOf="@+id/sender_profile_image_view"
app:layout_constraintStart_toStartOf="@+id/sender_profile_image_view"
app:layout_constraintTop_toTopOf="@+id/subject_text_view"
android:alpha="?attr/emphasisMediumAlpha"
android:background="?attr/actionBarItemBackground"
android:contentDescription="@string/navigate_back_icon_content_desc"
app:srcCompat="@drawable/ic_arrow_down" />
Line 63 is the app:src
attribute of the ImageButton
.
But it wasn’t a problem with line 63.
I thought this was the problem for a long time, but when I deleted the android:alpha="?attr/emphasisMediumAlpha"
line and ran it, The build has been completed.
This is code from CodeLab
Why does it cause an error?