Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I copy the code to my project,but it doesn't work,my support:appcompat-v7:22.1.1' #6

Closed
yanbing177 opened this issue May 23, 2015 · 4 comments

Comments

@yanbing177
Copy link

java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.liuyanbing.surveyor/cn.liuyanbing.surveyor.activity.SettingsActivity}: java.lang.RuntimeException: Binary XML file line #2: You must supply a layout_width attribute.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2190)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2239)
at android.app.ActivityThread.access$800(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5047)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Binary XML file line #2: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5948)
at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:6117)
at android.widget.LinearLayout$LayoutParams.(LinearLayout.java:1831)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1743)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
at android.view.LayoutInflater.inflate(LayoutInflater.java:483)
at android.view.LayoutInflater.inflate(LayoutInflater.java:400)
at com.kenumir.materialsettings.MaterialSettingsItem.initView(MaterialSettingsItem.java:31)
at com.kenumir.materialsettings.MaterialSettingsItem.getView(MaterialSettingsItem.java:36)
at com.kenumir.materialsettings.MaterialSettings.addItem(MaterialSettings.java:131)
at cn.liuyanbing.surveyor.activity.SettingsActivity.onCreate(SettingsActivity.java:20)
at android.app.Activity.performCreate(Activity.java:5249)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2154)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2239)
            at android.app.ActivityThread.access$800(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1202)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5047)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
            at dalvik.system.NativeStart.main(Native Method)

@kenumir
Copy link
Owner

kenumir commented May 23, 2015

Propably you not set layout_width attribute in your xml layout

@ihgoo
Copy link

ihgoo commented May 26, 2015

The Android manifest shoud add theme in the activity node,like this:

<activity
            android:name=".ui.SettingActivity"
            android:theme="@style/MaterialSettingsTheme">
</activity>

@kenumir kenumir closed this as completed Nov 4, 2015
@WeihuaGu
Copy link

@ihgoo I have added the ' android:theme="@style/MaterialSettingsTheme' in manifest file .
but it doesn't work still

Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: You must supply a layout_width attribute.
                                                                    Caused by: java.lang.UnsupportedOperationException: Binary XML file line #2: You must supply a layout_width attribute.

@WeihuaGu
Copy link

@kenumir I added the ' android:theme="@style/MaterialSettingsTheme' in manifest file
and in my layout don't have a xml file named "activity_material_settings.xml"

and I use the version is 1.2.2 by gradle.

the error still

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants