When integrating androidx.activity:activity in Android projects, an error is reported.xxx/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:5395: error: resource android:attr/lStar not found.error: failed linking references.
Analysis.
1. gradle introduces the configuration.
def activity_version = "1.4.0-alpha02"
// Java language implementation
implementation "androidx.activity:activity:$activity_version"
// Kotlin
implementation "androidx.activity:activity-ktx:$activity_version"
2. Project gradle configuration:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
3. The project is a brand-new project and kotlin has not been introduced, so it is not a kotlin version number problem.
4. After modifying the compilesdkversion and targetsdkversion to 31, the operation is normal.
Read More:
- Execution failed for task ‘:app:kaptDebugKotlin‘ [How to Solve]
- Flutter android studio runs gradle build error: Could not resolve all artifacts for configuration’:classpath’.
- Kotlin gets the ID automatically error [How to Solve]
- Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment
- How to Solve Project Upgrade to flutter2.5.0 Error
- [Solved] Android Studio Error: The binary version of its metadata is 1.5.1, expected version is 1.1.15.
- [Solved] Project Upgrade Gradle error (Bugly is integrated)
- [Solved] AAPT: error: resource android:attr/lStar not found
- [Solved] Compile Error: AAPT: error: resource android:attr/lStar not found
- [Solved] Android Studio 4.1 get manifestOutputDirectory error
- [Solved] Manifest merger failed with multiple errors, see logs
- error: resource android:attr/lStar not found [Pefect Solution]
- [Solved] Unity Package Error: FAILURE: Build failed with an exception.
- [Solved] Execution failed for task ‘:app:checkDebugAarMetadata‘
- [Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac
- [Solved] Execution failed for task ‘:app:mergeDebugJavaResource‘.
- Android studio New kotlin project Error: org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21-release-315
- ktor org.jetbrains:kotlin-css-jvm Dependency Failure [Solved]
- How to Solve Kotlin unresolved reference error
- Failed to find Build Tools revision 30.0.3 [How to Solve]