[英]How do I fix this error while running expo build android?
Hello, I need some help.你好,我需要一些帮助。 So what's the case is I am trying to build an android apk from my expo react app.
那么,我正在尝试从我的 expo react 应用程序构建一个 android apk。 But when I try to do so, it fails.
但是当我尝试这样做时,它失败了。 This is the output that is being shown when trying to run 'expo build:android'.
这是尝试运行“expo build:android”时显示的 output。 It works fine when run on expo client on android.
在 android 上的 expo 客户端上运行时,它工作正常。 Please help me.
请帮我。 The code for this project is in this GitHub repo .
这个项目的代码在这个 GitHub repo中。
✔ Choose the build type you would like: › apk
Checking if there is a build in progress...
Accessing credentials for setucoder in project storyhub5
✔ Would you like to upload a Keystore or have us generate one for you?
If you don't know what this means, let us generate it! :) › Generate new keystore
Failed to generate Android Keystore, it will be generated on Expo servers during the build
keytool exited with non-zero code: 1
Error: keytool exited with non-zero code: 1
at ChildProcess.completionListener (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Socket.<anonymous> (internal/child_process.js:439:11)
at Socket.emit (events.js:315:20)
at Pipe.<anonymous> (net.js:673:12)
...
at spawnAsync (/usr/local/lib/node_modules/expo-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
at createKeystore (/@expo/xdl@59.0.14/src/credentials/AndroidCredentials.ts:155:18)
at Object.generateUploadKeystore (/@expo/xdl@59.0.14/src/credentials/AndroidCredentials.ts:198:9)
at UpdateKeystore.provideOrGenerate (/usr/local/lib/node_modules/expo-cli/src/credentials/views/AndroidKeystore.ts:68:53)
at UpdateKeystore.open (/usr/local/lib/node_modules/expo-cli/src/credentials/views/AndroidKeystore.ts:39:22)
at CredentialsManager.run (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:41:12)
at runCredentialsManager (/usr/local/lib/node_modules/expo-cli/src/credentials/route.ts:12:10)
at AndroidBuilder.collectAndValidateCredentials (/usr/local/lib/node_modules/expo-cli/src/commands/build/AndroidBuilder.ts:88:7)
at AndroidBuilder.run (/usr/local/lib/node_modules/expo-cli/src/commands/build/AndroidBuilder.ts:33:5)
at AndroidBuilder.command (/usr/local/lib/node_modules/expo-cli/src/commands/build/BaseBuilder.ts:40:7)
keytool exited with non-zero code: 1
keytool exited with non-zero code: 1
Install the latest Java SE Development Kit
安装最新的
Java SE Development Kit
Installing JAVA SE 15 fixed this issue.安装 JAVA SE 15 解决了这个问题。 I think the key tool has something to do with java
我认为关键工具与java有关
I have same issue with expo's turtle build:android
command in my azure devops CI/CD pipeline(Running on macOs).我在我的 azure devops CI/CD 管道(在 macOs 上运行)中的 expo 的
turtle build:android
命令。 After a searching a bit more on this issue, I figured out the following.在对这个问题进行了更多搜索之后,我发现了以下内容。
The actual issue is the android build environment's JDK version should match the version of the JDK you have used while generating the keystore.jks
file using keytool
.实际问题是 android 构建环境的 JDK 版本应该与您在使用
keytool
生成keystore.jks
文件时使用的 JDK 版本匹配。 As of today(18-Nov-2021), the latest JAVA SE version was 17. If I use this latest version of SDK to generate keystore file, that couldn't be decrypted with build environment's JDK (which is not latest).截至今天(2021 年 11 月 18 日),最新的 JAVA SE 版本为 17。如果我使用此最新版本的 SDK 生成密钥库文件,则无法使用构建环境的 JDK(不是最新的)解密。 I have generated the
keystore.jks
file with JAVA SE 15. It worked for me.我用 JAVA SE 15 生成了
keystore.jks
文件。它对我有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.