2016-07-25 81 views
0

當我將我的庫23.0.1更改爲23.3.0,則會發生此錯誤,我必須更改我的庫。所以給我答案和解決方案。錯誤膨脹類android.support.design.widget.TextInputLayout

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.inn.microwave/com.inn.microwave.LoginActivity}: android.view.InflateException: Binary XML file line #37: Error inflating class android.support.design.widget.TextInputLayout 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
    at android.app.ActivityThread.access$800(ActivityThread.java:135) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:136) 
    at android.app.ActivityThread.main(ActivityThread.java:5001) 
    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:785) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
    at dalvik.system.NativeStart.main(Native Method) 

Caused by: java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library. 
    at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34) 
    at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:134) 
    at android.support.design.widget.TextInputLayout.<init>(TextInputLayout.java:127) 
    at java.lang.reflect.Constructor.constructNative(Native Method) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
    at android.view.LayoutInflater.createView(LayoutInflater.java:594) 
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290) 
    at android.app.Activity.setContentView(Activity.java:1929) 
    at com.inn.microwave.LoginActivity.onCreate(LoginActivity.java:77) 
    at android.app.Activity.performCreate(Activity.java:5231) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
    at android.app.ActivityThread.access$800(ActivityThread.java:135) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:136) 
    at android.app.ActivityThread.main(ActivityThread.java:5001) 
    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:785) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
    at dalvik.system.NativeStart.main(Native Method)  

的build.gradle

compileSdkVersion 23 
    buildToolsVersion "23.0.2" 
    useLibrary 'org.apache.http.legacy' 
    defaultConfig { 
    applicationId "com.inn.microwave" 
    minSdkVersion 16 
    targetSdkVersion 23 

扶養

compile 'com.google.code.gson:gson:2.2.4' 
compile 'com.android.support:design:23.3.0' 
compile 'com.android.support:appcompat-v7:23.3.0' 
compile 'com.android.support:support-v4:23.3.0' 
compile 'com.android.support:recyclerview-v7:23.3.0' 
compile 'com.android.support:cardview-v7:23.3.0' 
+0

請出示完整的logcat –

+0

顯示您的XML和Java文件 –

+0

您也可能要考慮讓最新的SDK版本; 24。*。* – Eenvincible

回答

0

Finnaly我解決了錯誤

我已經設置正確的主題,在的Manifest.xml <機應用>標籤,但我是手動設置錯了主題,我<活動>標籤。

所以,我從<活動主題刪除>manifest.xml中的T​​AG

0

只是清理項目,並重建它之前運行該項目。它會解決你的問題。

+0

我試了一下,但它不是工作 – Sanjaysinh

+0

你有你的SDK更新哪些是必要的。? –

相關問題