我如何在Appcenter上的React-native项目上修复此错误?

u1ehiz5o  于 2023-01-31  发布在  React
关注(0)|答案(1)|浏览(204)

我曾尝试在appcenter上对应用进行bluid,这是我的第一个错误,错误是JAVA版本(Android Gradle插件需要Java 11才能运行。您当前使用的是Java 1.8),因此我安装了https://www.azul.com/downloads/?package=jdk
现在我面临着这个错误

##[section]Starting: Build
##[section]Starting: Initialize job
Agent name: 'Hosted Agent'
Agent machine name: 'Mac-1675090393322'
Current agent version: '2.214.1'
##[group]Operating System
macOS
11.7.2
20G1020
##[endgroup]
##[group]Runner Image
Image: macos-11
Version: 20230117.2
Included Software: https://github.com/actions/runner-images/blob/macOS-11/20230117.2/images/macos/macos-11-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/macOS-11%2F20230117.2
##[endgroup]
##[group]Runner Image Provisioner
2.0.98.1
##[endgroup]
Current image version: '20230117.2'
Agent running as: 'runner'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: PowerShell (2.212.0)
Downloading task: Bash (3.214.0)
Downloading task: CmdLine (1.1.3)
Downloading task: ShellScript (2.212.0)
Downloading task: CmdLine (2.212.0)
Downloading task: Gradle (1.128.0)
Downloading task: CopyFiles (2.211.0)
Downloading task: PublishBuildArtifacts (1.211.0)
Downloading task: AppCenterDistribute (3.214.0)
Checking job knob settings.
   Knob: AgentToolsDirectory = /Users/runner/hostedtoolcache Source: ${AGENT_TOOLSDIRECTORY} 
Finished checking job knob settings.
Start tracking orphan processes.
##[section]Finishing: Initialize job
##[section]Starting: Checkout app-mobile@staging to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Syncing repository: app-mobile (ExternalGit)
##[command]git version
git version 2.39.1
##[command]git lfs version
git-lfs/3.3.0 (GitHub; darwin amd64; go 1.19.3)
##[command]git init "/Users/runner/work/1/s"
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
Initialized empty Git repository in /Users/runner/work/1/s/.git/
hint: 
hint:   git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint:   git branch -m <name>
##[command]git remote add origin https://github.com/test-io/app-mobile.git
##[command]git config gc.auto 0
##[command]git config --get-all http.https://github.com/test-io/app-mobile.git.extraheader
##[command]git config --get-all http.extraheader
##[command]git config --get-regexp .*extraheader
##[command]git config --get-all http.proxy
##[command]git config http.version HTTP/1.1
##[command]git remote set-url origin https://***:***@github.com/test-io/app-mobile.git
##[command]git remote set-url --push origin https://***:***@github.com/test-io/app-mobile.git
##[command]git lfs install --local
Updated Git hooks.
Git LFS initialized.
##[command]git config remote.origin.lfsurl https://***:***@github.com/test-io/app-mobile.git/info/lfs
##[command]git config remote.origin.lfspushurl https://***:***@github.com/test-io/app-mobile.git/info/lfs
##[command]git fetch --force --tags --prune --prune-tags --progress --no-recurse-submodules origin
remote: Enumerating objects: 7768, done.        
remote: Counting objects:   0% (1/1501)        
remote: Counting objects:   1% (16/1501)        
remote: Counting objects:   2% (31/1501)        
remote: Counting objects:   3% (46/1501)        
remote: Counting objects:   4% (61/1501)        
remote: Counting objects:   5% (76/1501)        
remote: Counting objects:   6% (91/1501)        
remote: Counting objects:   7% (106/1501)        
remote: Counting objects:   8% (121/1501)        
remote: Counting objects:   9% (136/1501)        
remote: Counting objects:  10% (151/1501)        
remote: Counting objects:  11% (166/1501)        
remote: Counting objects:  12% (181/1501)        
remote: Counting objects:  13% (196/1501)        
remote: Counting objects:  14% (211/1501)        
remote: Counting objects:  15% (226/1501)        
remote: Counting objects:  16% (241/1501)        
remote: Counting objects:  17% (256/1501)        
remote: Counting objects:  18% (271/1501)        
remote: Counting objects:  19% (286/1501)        
remote: Counting objects:  20% (301/1501)        
remote: Counting objects:  21% (316/1501)        
remote: Counting objects:  22% (331/1501)        
remote: Counting objects:  23% (346/1501)        
remote: Counting objects:  24% (361/1501)        
remote: Counting objects:  25% (376/1501)        
remote: Counting objects:  26% (391/1501)        
remote: Counting objects:  27% (406/1501)        
remote: Counting objects:  28% (421/1501)        
remote: Counting objects:  29% (436/1501)        
remote: Counting objects:  30% (451/1501)        
remote: Counting objects:  31% (466/1501)        
remote: Counting objects:  32% (481/1501)        
remote: Counting objects:  33% (496/1501)        
remote: Counting objects:  34% (511/1501)        
remote: Counting objects:  35% (526/1501)        
remote: Counting objects:  36% (541/1501)        
remote: Counting objects:  37% (556/1501)        
remote: Counting objects:  38% (571/1501)        
remote: Counting objects:  39% (586/1501)        
remote: Counting objects:  40% (601/1501)        
remote: Counting objects:  41% (616/1501)        
remote: Counting objects:  42% (631/1501)        
remote: Counting objects:  43% (646/1501)        
remote: Counting objects:  44% (661/1501)        
remote: Counting objects:  45% (676/1501)        
remote: Counting objects:  46% (691/1501)        
remote: Counting objects:  47% (706/1501)        
remote: Counting objects:  48% (721/1501)        
remote: Counting objects:  49% (736/1501)        
remote: Counting objects:  50% (751/1501)        
remote: Counting objects:  51% (766/1501)        
remote: Counting objects:  52% (781/1501)        
remote: Counting objects:  53% (796/1501)        
remote: Counting objects:  54% (811/1501)        
remote: Counting objects:  55% (826/1501)        
remote: Counting objects:  56% (841/1501)        
remote: Counting objects:  57% (856/1501)        
remote: Counting objects:  58% (871/1501)        
remote: Counting objects:  59% (886/1501)        
remote: Counting objects:  60% (901/1501)        
remote: Counting objects:  61% (916/1501)        
remote: Counting objects:  62% (931/1501)        
remote: Counting objects:  63% (946/1501)        
remote: Counting objects:  64% (961/1501)        
remote: Counting objects:  65% (976/1501)        
remote: Counting objects:  66% (991/1501)        
remote: Counting objects:  67% (1006/1501)        
remote: Counting objects:  68% (1021/1501)        
remote: Counting objects:  69% (1036/1501)        
remote: Counting objects:  70% (1051/1501)        
remote: Counting objects:  71% (1066/1501)        
remote: Counting objects:  72% (1081/1501)        
remote: Counting objects:  73% (1096/1501)        
remote: Counting objects:  74% (1111/1501)        
remote: Counting objects:  75% (1126/1501)        
remote: Counting objects:  76% (1141/1501)        
remote: Counting objects:  77% (1156/1501)        
remote: Counting objects:  78% (1171/1501)        
remote: Counting objects:  79% (1186/1501)        
remote: Counting objects:  80% (1201/1501)        
remote: Counting objects:  81% (1216/1501)        
remote: Counting objects:  82% (1231/1501)        
remote: Counting objects:  83% (1246/1501)        
remote: Counting objects:  84% (1261/1501)        
remote: Counting objects:  85% (1276/1501)        
remote: Counting objects:  86% (1291/1501)        
remote: Counting objects:  87% (1306/1501)        
remote: Counting objects:  88% (1321/1501)        
remote: Counting objects:  89% (1336/1501)        
remote: Counting objects:  90% (1351/1501)        
remote: Counting objects:  91% (1366/1501)        
remote: Counting objects:  92% (1381/1501)        
remote: Counting objects:  93% (1396/1501)        
remote: Counting objects:  94% (1411/1501)        
remote: Counting objects:  95% (1426/1501)        
remote: Counting objects:  96% (1441/1501)        
remote: Counting objects:  97% (1456/1501)        
remote: Counting objects:  98% (1471/1501)        
remote: Counting objects:  99% (1486/1501)        
remote: Counting objects: 100% (1501/1501)        
remote: Counting objects: 100% (1501/1501), done.        
remote: Compressing objects: 100% (570/570), done.        
Receiving objects:  98% (7613/7768)
remote: Total 7768 (delta 989), reused 1125 (delta 913), pack-reused 6267        
Receiving objects: 100% (7768/7768), 13.60 MiB | 27.15 MiB/s, done.
Resolving deltas: 100% (4515/4515), done.
From https://github.com/test-io/app-mobile
 * [new branch]      dev                  -> origin/dev
 * [new branch]      develop_bk           -> origin/develop_bk
 * [new branch]      fix-npm-build-error  -> origin/fix-npm-build-error
 * [new branch]      fixIntermediateStops -> origin/fixIntermediateStops
 * [new branch]      main                 -> origin/main
 * [new branch]      pick-up-point        -> origin/pick-up-point
 * [new branch]      staging              -> origin/staging
##[command]git checkout 7887c0f5c3331ddf80738738a721561dca8ac8a0 -- .lfsconfig
error: pathspec '.lfsconfig' did not match any file(s) known to git
##[command]git lfs fetch origin 7887c0f5c3331ddf80738738a721561dca8ac8a0
fetch: Fetching reference 7887c0f5c3331ddf80738738a721561dca8ac8a0
##[command]git checkout --progress --force 7887c0f5c3331ddf80738738a721561dca8ac8a0
HEAD is now at 7887c0f Merge branch 'staging' of https://github.com/test-io/app-mobile into staging
##[command]git submodule sync --recursive
##[command]git submodule update --init --force --recursive
##[command]git remote set-url origin https://github.com/test-io/app-mobile.git
##[command]git remote set-url --push origin https://github.com/test-io/app-mobile.git
##[command]git config --unset-all remote.origin.lfsurl
##[command]git config --unset-all remote.origin.lfspushurl
##[section]Finishing: Checkout app-mobile@staging to s
##[section]Starting: Install build scripts
==============================================================================
Task         : PowerShell
Description  : Run a PowerShell script on Linux, macOS, or Windows
Version      : 2.212.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell
==============================================================================
Generating script.
========================== Starting Command Output ===========================
[command]/usr/local/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command . '/Users/runner/work/_temp/60981a72-50ee-4163-a24c-89ee83d5914e.ps1'
Reinstalling Gradle init script plugins from /Users/runner/runners/2.214.1/scripts/gradle-init-script-plugins...
##[section]Finishing: Install build scripts
##[section]Starting: Select Node.js Version v2
==============================================================================
Task         : Bash
Description  : Run a Bash script on macOS, Linux, or Windows
Version      : 3.214.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/bash
==============================================================================
Generating script.
Formatted command: exec bash '/Users/runner/runners/2.214.1/scripts/select-node-version.sh' node16
========================== Starting Command Output ===========================
[command]/bin/bash /Users/runner/work/_temp/5fb58e04-a0b5-4a75-9f03-271e187e5641.sh
v16.19.0 is already installed.
Now using node v16.19.0 (npm v8.19.3)
default -> v16.19.0 *
Node version: v16.19.0
npm version: 8.19.3
##[section]Finishing: Select Node.js Version v2
##[section]Starting: yarn/npm install
==============================================================================
Task         : Command Line
Description  : Run a command line with arguments
Version      : 1.1.3
Author       : Microsoft Corporation
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkID=613735)
==============================================================================
[command]/bin/sh -c if [ -f yarn.lock ]; then { yarn install --network-timeout=600000 && yarn list --depth=0; } else npm install; fi
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
(node:2298) Warning: Use Cipheriv for counter mode of aes-256-ctr
npm WARN deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @react-native-community/masked-view@0.1.11: Repository was moved to @react-native-masked-view/masked-view
npm WARN deprecated @aws-amplify/ui@2.0.7: Versions '1.x' and '2.x' of '@aws-amplify/ui' have been deprecated. Please visit https://ui.docs.amplify.aws/ for the current version of Amplify UI.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

added 2236 packages, and audited 2237 packages in 1m

156 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
##[section]Finishing: yarn/npm install
##[section]Starting: Pre Build Script
==============================================================================
Task         : Shell script
Description  : Run a shell script using Bash
Version      : 2.212.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/shell-script
==============================================================================
##[error]Not found scriptPath: /Users/runner/work/1/s/appcenter-pre-build.sh
##[error]Bash failed with error: Not found scriptPath: /Users/runner/work/1/s/appcenter-pre-build.sh
##[section]Finishing: Pre Build Script
##[section]Starting: Checkout app-mobile@staging to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: app-mobile (ExternalGit)
##[section]Finishing: Checkout app-mobile@staging to s
##[section]Starting: Finalize Job
Cleaning up task key
Start cleaning up orphan processes.
##[section]Finishing: Finalize Job
##[section]Finishing: Build

我曾尝试将此org.gradle.java.home=/应用程序/Android www.example.com添加Studio.app/Contents/jre/jdk/Contents/Home到我gradle.properties

ee7vknir

ee7vknir1#

AppCenter构建运行器已经为用户预定义了一些变量,以便用户配置其构建。
您可以在AppCenter上的构建配置中将JAVA_HOME环境变量设置为$(JAVA_HOME_11_X64)

相关问题