12

में विशेषता 'layout_constraintLeft_toLeftOf' विशेषता के लिए कोई संसाधन पहचानकर्ता नहीं मिला है, मैं एंड्रॉइड एसडीके 2.2.3 का उपयोग कर रहा हूं। मैं एंड्रॉइड प्रोग्रामिंग पर एक पुस्तक का पालन कर रहा हूं।पैकेज

कोड है:

<android.support.constraint.ConstraintLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/activity_main" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context="eu.a123sandberg.webview.MainActivity" 
    tools:layout_editor_absoluteX="0dp" 
    tools:layout_editor_absoluteY="81dp"> 

    <WebView 
     android:layout_width="384dp" 
     android:layout_height="511dp" 
     tools:layout_editor_absoluteX="0dp" 
     tools:layout_editor_absoluteY="0dp" 
     app:layout_constraintLeft_toLeftOf="@+id/activity_main" 
     tools:layout_constraintLeft_creator="0" 
     app:layout_constraintTop_toTopOf="@+id/activity_main" 
     tools:layout_constraintTop_creator="0" 
     app:layout_constraintRight_toRightOf="@+id/activity_main" 
     tools:layout_constraintRight_creator="0" 
     app:layout_constraintBottom_toBottomOf="@+id/activity_main" 
     tools:layout_constraintBottom_creator="0" 
     /> 

</android.support.constraint.ConstraintLayout> 

मैं android.support.constraint.ConstraintLayout साथ तीन अलग अलग उदाहरण की कोशिश की है और मैं एक ही त्रुटि संदेश मिलता है में सभी मामलों कार्य करें:

Error:(13) No resource identifier found for attribute 'layout_constraintLeft_toLeftOf' in package 'eu.a123sandberg.webview' 

build.gradle फ़ाइल में शामिल हैं:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "eu.a123sandberg.webview" 
     minSdkVersion 21 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
                        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-     android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-   core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.1.1' 
    testCompile 'junit:junit:4.12' 
} 

त्रुटि को हल करने के लिए मुझे क्या करना है?

मैंने त्रुटि को गुमराह किया है और त्रुटि को हल करने वाले सुझाव को खोजने में सक्षम नहीं है।

कृपया मदद करें।

उत्तर

27

ConstraintLayout AppCompat का हिस्सा नहीं है। यह एक स्टैंडअलोन लाइब्रेरी है। अपने build.gradle फ़ाइल

compile 'com.android.support.constraint:constraint-layout:1.0.2' 

और Sync now क्लिक में

जोड़ें निर्भरता।