【问题标题】:Appcenter android build fails to install in deviceAppcenter android build 无法在设备中安装
【发布时间】:2023-03-04 00:00:01
【问题描述】:

我已经在 appcenter 中配置了我的 react-native 应用程序以进行构建和分发。一切正常,突然之间,构建失败并出现以下错误

> Task :app:stripReleaseDebugSymbols FAILED
Support for ANDROID_NDK_HOME is deprecated and will be removed in the future. Use android.ndkVersion in build.gradle instead.

> Task :app:mergeExtDexRelease

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:stripReleaseDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

* 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.

点击此链接https://github.com/microsoft/appcenter/issues/2144 并将我的成绩文件更新为

buildscript {
    ext {
        ndkVersion = "20.1.5948944"
    }
    
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
   }

和 gradle-wrapper.properties 到

distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip

在此之后构建工作,但构建后分发的应用程序无法安装在设备上并出现“未安装应用程序”错误。我尝试了不同的版本,目前没有成功。

【问题讨论】:

    标签: android react-native ndk-build visual-studio-app-center-distribute


    【解决方案1】:

    我可以通过以下设置解决问题

    在 graddle-wrapper.properties 中将 distributionUrl 更新为

    distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
    

    在 android/build.gradle 更新 gradle 版本到

    classpath("com.android.tools.build:gradle:4.2.0")
    

    将 react-native 版本更新为 0.65.1

    npm i react-native@0.65.1
    
    

    更新了所有相关的包以兼容这个 react-native 版本

    npm update "react-native"
    
    

    在此之后,我能够在 appcenter 中构建它并能够分发和安装应用程序

    【讨论】:

      【解决方案2】:

      有类似的问题。通过查看构建日志检查了 VSAC 中支持哪些 ndk 版本后,我使用以下 ndk 版本更新了android/build.gradle,它工作正常。

      buildscript {
          ext {
              ...
              ndkVersion = "18.1.5063045"
          }
          ...
      }
      
      

      【讨论】:

      • 我试过这个。在 appcenter 中构建成功,但分布式应用程序没有安装在手机上。它再次给出“未安装应用程序”错误
      • 您是否恢复了对android/build.gradlegradle-wrapper.properties 中的gradle 版本所做的更改?
      • 我恢复到 distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip 和 classpath("com.android.tools.build:gradle:3.5.3 ") 现在构建失败了
      • 你能分享你的版本吗?我可以试试这个
      • distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zipgradle-wrapper.propertiesclasspath("com.android.tools.build:gradle:3.5.3")build.gradle。构建日志的状态是什么?
      猜你喜欢
      • 1970-01-01
      • 2015-10-23
      • 1970-01-01
      • 2019-08-07
      • 2013-03-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-10
      相关资源
      最近更新 更多