Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

缺少android.useAndroidX=true配置以及 AndroidManifest 缺少 android:exported="true", 编译失败 #1215

Open
SerendipityMatthew opened this issue Jan 26, 2024 · 0 comments

Comments

@SerendipityMatthew
Copy link

  1. 因为缺少 android.useAndroidX=true 的 配置导致编译失败,出现如下的编译错误。
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
* What went wrong:
Execution failed for task ':banner:generateDebugRFile'.
Configuration `debugRuntimeClasspath` contains AndroidX dependencies, but the `android.useAndroidX` property is not enabled, which may cause runtime issues.
  Set `android.useAndroidX=true` in the `gradle.properties` file and retry.
  The following AndroidX dependencies are detected:
  debugRuntimeClasspath -> androidx.viewpager2:viewpager2:1.1.0-beta02 
  1. 因为 AndroidManifest.xml 的 Activity 缺少 android:exported="true",导致编译失败。出现了如下编译错误日志
Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.spring.usekotlin.MainActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

建议添加上这两个配置代码。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant