2016-09-09 5 views
0

Android 개발을 배우려고합니다. Android Studio 2.1.3을 사용하고 로그인 기능을 만들려고했습니다. 프로젝트를 생성하는 동안 로그인 액티비티 템플릿을 사용하고 마법사의 다른 모든 것을 기본값으로 남겨 둡니다. 내가 정확히 무엇을 만들었는지 미리 보려고 시도했을 때이 오류를 보여줍니다.다음 클래스를 인스턴스화 할 수 없습니다 : android.support.design.widget.TextInputLayout

다음 클래스는 인스턴스화 할 수 없습니다

android.support.design.widget.TextInputLayout

를 기본적으로 내가 15 만 여전히 같은 오류를 변경 (24)으로 표시 한 대상으로 안드로이드 버전. 어떻게 해결할 수 있을까요?

enter image description here

레이아웃 XML은

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:gravity="center_horizontal" 
    android:orientation="vertical" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    tools:context="com.example.user.loginapp.Login"> 

    <!-- Login progress --> 
    <ProgressBar 
     android:id="@+id/login_progress" 
     style="?android:attr/progressBarStyleLarge" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="8dp" 
     android:visibility="gone" /> 

    <ScrollView 
     android:id="@+id/login_form" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:id="@+id/email_login_form" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/email" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_email" 
        android:inputType="textEmailAddress" 
        android:maxLines="1" 
        android:singleLine="true" /> 

      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <EditText 
        android:id="@+id/password" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_password" 
        android:imeActionId="@+id/login" 
        android:imeActionLabel="@string/action_sign_in_short" 
        android:imeOptions="actionUnspecified" 
        android:inputType="textPassword" 
        android:maxLines="1" 
        android:singleLine="true" /> 

      </android.support.design.widget.TextInputLayout> 

      <Button 
       android:id="@+id/email_sign_in_button" 
       style="?android:textAppearanceSmall" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="16dp" 
       android:text="@string/action_sign_in" 
       android:textStyle="bold" /> 

     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 
+0

사용중인 레이아웃 파일에 대한 XML을 제공해 주실 수 있습니까? –

+0

또한 답변을 http://stackoverflow.com/questions/26575815/the-following-classes-could-not-be-instantiated-android-support-v7-widget-too에서 시도하고 그 중 하나가 작동하는지 확인하십시오. 당신. –

+0

@ChadSchultz 지금 xml 레이아웃으로 질문을 업데이트했습니다. 또한 캐시 무효화/재시작을 시도했지만 문제가 해결되지 않았습니다. 또한 안드로이드 버전을 24에서 15로 변경해 보았습니다. 문제가 해결되지 않았습니다. – prasanth

답변

0

당신은 당신의 Gradle을에 compile 'com.android.support:appcompat-v7:xxx 을 추가하여 APPCOMPAT 사용하거나 위의 21에 Gradle을에 minsdk을 변경할 수 있습니다 (lolipop는에 처음이다 지원 재료 설계).

Read Documention here

은 이전 버전과의 호환성을 유지에 대한 정보를 얻으실 수 있습니다.

관련 문제