--> -->
NativeScriptでandroid向けのビルドをした際に、突然以下のエラーが出ました。
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugManifest'. > Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:22:2-43:16 to override. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 16s Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.
androidx対応時には環境の設定が必要なようです。 参考ページの通り、以下のコマンドを発行して無事ビルドが通るようになりました。
> npm install tns-core-modules@androidx --save-exact > tns platform add android@androidx
tns platform remove androidでplatformを初期化した後には再度必要なようですので注意が必要です。
素直にNativeScript6.0に上げるのが良いかも。
Tweet