我有一个奇怪的错误,我无法摆脱...
此错误是在实际设备的生产中发生的,但仅在特定型号的LG K10设备上才发生,由于崩溃原因,我知道该错误,但我不拥有LG K10来尝试在开发人员中重现该问题。 / p>
此错误已经发生很长时间了,我还没有想法为什么会发生
这是堆栈跟踪:
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tomatedigital.instagramgiveawaywinner/com.tomatedigital.giveawaymaster.activity.LoginActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.support.v7.widget.LinearLayoutCompat
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5530)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
Caused by java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:666)
at android.view.View.(View.java:3970)
at android.view.ViewGroup.(ViewGroup.java:573)
at android.view.ViewGroup.(ViewGroup.java:569)
at android.support.v7.widget.LinearLayoutCompat.(SourceFile:152)
at android.support.v7.widget.LinearLayoutCompat.(SourceFile:148)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at android.view.LayoutInflater.createView(LayoutInflater.java:619)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.tomatedigital.giveawaymaster.activity.AdsAppCompatActivity.addExtras(AdsAppCompatActivity.java:349)
at com.tomatedigital.giveawaymaster.activity.AdsAppCompatActivity.setContentView(AdsAppCompatActivity.java:349)
at com.tomatedigital.giveawaymaster.activity.MenuAdsAppCompatActivity.setContentView(MenuAdsAppCompatActivity.java:62)
at com.tomatedigital.giveawaymaster.activity.LoginActivity.setContentView(LoginActivity.java:201)
at com.tomatedigital.giveawaymaster.activity.LoginActivity.onCreate(LoginActivity.java:259)
at android.app.Activity.performCreate(Activity.java:6272)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5530)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:734)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
它说我的主要活动的布局出现问题,我已经检查过,绝对没有错,所有尺寸都可以而且有效... 我每天有超过4k的用户使用数十种不同的手机型号,并且100%的错误发生在此设备上,有人可以给我提示要检查什么的提示 这是布局文件
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/mainView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingLeft="@dimen/smallMargin"
android:paddingTop="@dimen/smallMargin"
android:paddingRight="@dimen/smallMargin"
tools:context="com.tomatedigital.giveawaymaster.activity.LoginActivity">
<android.support.v7.widget.AppCompatImageView
android:id="@+id/welcomeImage"
android:layout_width="match_parent"
android:layout_height="@dimen/welcomeImageHeight"
android:layout_marginBottom="@dimen/tinyMargin"
android:scaleType="fitCenter"
android:src="@drawable/ic_instagram_winner" />
<android.support.v7.widget.LinearLayoutCompat
android:id="@+id/contentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.AppCompatEditText
android:id="@+id/textUsername"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_email"
android:inputType="text"
android:maxLines="1"
android:textSize="@dimen/normalFont" />
<android.support.v7.widget.AppCompatEditText
android:id="@+id/textPassword"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="6"
android:imeActionLabel="@string/login"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:textSize="@dimen/normalFont" />
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.v7.widget.AppCompatButton
android:id="@+id/loginButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/medium_margim"
android:text="@string/login"
android:textStyle="bold" />
<Space
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<android.support.v7.widget.AppCompatButton
android:id="@+id/facebookLogin"
android:layout_width="wrap_content"
android:layout_height="37dp"
android:layout_marginRight="@dimen/medium_margim"
android:background="@color/com_facebook_blue"
android:drawableRight="@drawable/com_facebook_button_icon"
android:drawablePadding="@dimen/tinyMargin"
android:paddingLeft="@dimen/tinyMargin"
android:paddingRight="@dimen/tinyMargin"
android:text="@string/facebooklogin"
android:textColor="@color/com_facebook_button_text_color" />
</android.support.v7.widget.LinearLayoutCompat>
<TextView
android:id="@+id/resetPasswordLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallMargin"
android:autoLink="all"
android:gravity="center"
android:linksClickable="true"
android:text="@string/forgot_password"
android:textColor="#0000EE"
android:textSize="@dimen/normalFont" />
</android.support.v7.widget.LinearLayoutCompat>
</android.support.v7.widget.LinearLayoutCompat>