The answer is in Message "error: resource android:attr/lStar not found".
Add the following code to app/android/build.gradle file solves the problem.
subprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34
buildToolsVersion "34.0.0"
}
}
}
}