在nativescript版本更改后,如何正确构建android应用程序

在nativescript版本更改后,如何正确构建android应用程序,android,build.gradle,nativescript,Android,Build.gradle,Nativescript,我在构建nativescript android应用程序时出错 我正在使用NativeScript 5.2开发一个Android应用程序。然而,我的一位同事使用NativeScript 6将git推送到开发分支。我拉了它,tns迁移了,它不能再建造了。它不断显示命令gradlew.bat失败,退出代码为1 我尝试过将我的NativeScript升级到他的版本,也尝试过还原NativeScript和git分支,但仍然显示相同的错误 错误代码: Gradle build... +

我在构建nativescript android应用程序时出错

我正在使用NativeScript 5.2开发一个Android应用程序。然而,我的一位同事使用NativeScript 6将git推送到开发分支。我拉了它,tns迁移了,它不能再建造了。它不断显示命令gradlew.bat失败,退出代码为1

我尝试过将我的NativeScript升级到他的版本,也尝试过还原NativeScript和git分支,但仍然显示相同的错误

错误代码:

 Gradle build...
         + setting applicationId
         + applying user-defined configuration from C:\Users\Le\Documents\Work\work-app-investor\app\App_Resources\Android\app.gradle
         + using support library version 28.0.0
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-background-http\platforms\android\nativescript_background_http.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-camera\platforms\android\nativescript_camera.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-fingerprint-auth\platforms\android\nativescript_fingerprint_auth.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-loading-indicator\platforms\android\nativescript_loading_indicator.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-material-textfield\platforms\android\nativescript_material_textfield.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-pager\platforms\android\nativescript_pager.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-plugin-firebase\platforms\android\firebase-release.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-plugin-firebase\platforms\android\nativescript_plugin_firebase.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\nativescript-material-core\platforms\android\nativescript_material_core.aar
         + adding aar plugin dependency: C:\Users\Le\Documents\Work\work-app-investor\node_modules\tns-core-modules-widgets\platforms\android\widgets-release.aar

    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection) registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

C:\Users\Le\Documents\Work\work-app-investor\platforms\android\app\src\main\AndroidManifest.xml:22:18-91 Error:
        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.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:25:2-47:16 to override.
    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.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
        Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:25:2-47: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 2s
Unable to apply changes on device: 8DQCIF45VCSOTOYH. Error is: Command gradlew.bat failed with exit code 1.
gradlebuild。。。
+设置应用程序ID
+从C:\Users\Le\Documents\Work\Work-app-investor\app\app\u-Resources\Android\app.gradle应用用户定义的配置
+使用支持库版本28.0.0
+添加nativescript运行时包依赖项:使用inspector优化的nativescript
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript background http\platforms\android\nativescript\u background\u http.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work-app-investor\node\u modules\nativescript-camera\platforms\android\nativescript\u-camera.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript fingerprint auth\platforms\android\nativescript\u fingerprint\u auth.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript loading indicator\platforms\android\nativescript\u loading\u indicator.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript material textfield\platforms\android\nativescript\u material\u textfield.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript pager\platforms\android\nativescript\u pager.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript plugin firebase\platforms\android\firebase-release.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript plugin firebase\platforms\android\nativescript\u plugin\u firebase.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\nativescript material core\platforms\android\nativescript\u material\u core.aar
+添加aar插件依赖项:C:\Users\Le\Documents\Work\Work app investor\node\u modules\tns core modules widgets\platforms\android\widgets-release.aar
registerResGeneratingTask已弃用,请使用registerGeneratedResFolders(文件集合)registerResGeneratingTask已弃用,请使用registerGeneratedResFolders(文件集合)
C:\Users\Le\Documents\Work\Work-app-investor\platforms\android\app\src\main\AndroidManifest.xml:22:18-91错误:
属性application@appComponentFactory值=(android.support.v4.app.CoreComponentFactory)来自[com.android.support:support compat:28.0.0]AndroidManifest.xml:22:18-91
也出现在[androidx.core:core:1.1.0]AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory)中。
建议:在AndroidManifest.xml:25:2-47:16处的元素中添加“tools:replace=“android:appComponentFactory””以覆盖。
失败:生成失败,出现异常。
*出了什么问题:
任务“:app:processDebugManifest”的执行失败。
>清单合并失败:属性application@appComponentFactory值=(android.support.v4.app.CoreComponentFactory)来自[com.android.support:support compat:28.0.0]AndroidManifest.xml:22:18-91
也出现在[androidx.core:core:1.1.0]AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory)中。
建议:在AndroidManifest.xml:25:2-47:16处的元素中添加“tools:replace=“android:appComponentFactory””以覆盖。
*尝试:
使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。使用--scan运行以获得完整的洞察力。
*得到更多的帮助https://help.gradle.org
2秒内生成失败
无法在设备8DQCIF45VCSOTOYH上应用更改。错误为:命令gradlew.bat失败,退出代码为1。

您应该首先检查插件是否支持AndroidX——根据您的构建消息,您似乎有一些支持AndroidX的插件。
通常你只需要在你的
包中更新它们。json
,做一个
tns平台清理android
,然后重新构建。

请不要附加图像。始终提供文本格式代码/输出/错误消息等。这是我的答案。显然,我的nativescript material core已更新到上面的2.3.*版本,在该版本中,它们迁移到了AndroidX。