Issue
this is the error i get when i try to run application I don't know how solve this my IDE recommend to migrate to androidx but it doesn't run when I tried this all help can be useful for me thank you!
Android resource linking failed
C:\Users\hp\AndroidStudioProjects\Surv_pt1\app\src\main\res\layout\activity_signup.xml:81: AAPT: error: resource style/Widget.MaterielComponents.TextInputLayout.OutlineBox (aka com.example.surv_pt1:style/Widget.MaterielComponents.TextInputLayout.OutlineBox) not found.
C:\Users\hp\AndroidStudioProjects\Surv_pt1\app\src\main\res\layout\activity_signup.xml:81: AAPT: error: resource dimen/margin_8dp (aka com.example.surv_pt1:dimen/margin_8dp) not found.
the xml file code concerned
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".signupActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark">
<ImageButton
android:id="@+id/helpButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginRight="2dp"
app:srcCompat="@drawable/ic_help_black_24dp"
android:layout_gravity="right"
android:background="?attr/colorPrimary"
tools:ignore="VectorDrawableCompat" />
</androidx.appcompat.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/imageAndText"
android:layout_width="match_parent"
android:layout_height="435dp"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="TextView" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<ImageView
android:id="@+id/imageView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/ic_person_add_black_24dp"
tools:ignore="VectorDrawableCompat" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/InfosUser"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterielComponents.TextInputLayout.OutlineBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8dp"
android:hint="username">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical"></LinearLayout>
</LinearLayout>
</LinearLayout>
this is the gradle file dependencies(module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.surv_pt1"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.android.material:material:1.0.0'
}
the second gradle file(projet)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Solution
In the section below need to remove some parts.
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterielComponents.TextInputLayout.OutlineBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_8dp"
android:hint="username">
Remove the style
and replace the marginTop
. remove the whole style="@style/Widget.MaterielComponents.TextInputLayout.OutlineBox"
line. Replace @dimen/margin_8dp
with 8dp. that will be android:layout_marginTop="8dp"
Answered By - K M Rejowan Ahmmed
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.