openimsdk / open-im-sdk-flutter

IM SDK Flutter
https://openim.io
MIT License
365 stars 232 forks source link

[BUG] flutter update to 3.24 android build error AAPT: error: resource android:attr/lStar not found. #148

Closed whevether closed 2 months ago

whevether commented 3 months ago

Describe the bug flutter update to 3.24 android build error AAPT: error: resource android:attr/lStar not found.

How to reproduce flutter update to 3.24, Create project, add SDK, and then compile

Steps to reproduce the behavior:

  1. flutter update to 3.24
  2. Create project
  3. Command line execution flutter pub add flutter_openim_sdk;
  4. Command line execution flutter build apk
  5. alert build error FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':flutter_openim_sdk:verifyReleaseResources'. A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action Android resource linking failed ERROR:/Users/user/Desktop/test11/build/flutter_openim_sdk/intermediates/merged_res/release/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.

Expected behavior Can compile normally

Version information

Additional context flutter update document link

std-s commented 3 months ago

We'll follow up on this soon.

whevether commented 2 months ago

We'll follow up on this soon.

I have found a solution. Modify the subprojects under the build.gradle file in Android and add the following code

subprojects { afterEvaluate { project -> if (project.plugins.hasPlugin("com.android.application") || project.plugins.hasPlugin("com.android.library")) { project.android { compileSdkVersion 34 buildToolsVersion "34.0.0" } } } project.buildDir = "${rootProject.buildDir}/${project.name}" project.evaluationDependsOn(':app') }