简体   繁体   English

如何在运行 expo build android 时修复此错误?

[英]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)

Solution - March 2021 (on macOs - Big Sur)解决方案 - 2021 年 3 月(在 macOS 上 - Big Sur)

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

相关问题 如何解决此cordova构建错误? - How do I fix this cordova build error? 如何修复Expo Android Build Gradle API资源故障 - How to fix Expo Android Build Gradle API Resource Failures 运行后台线程时如何修复android中的内存不足错误 - How to fix out of memory error in android while running background thread expo build (IOS &amp; android) 和 Expo 发布错误 - expo build (IOS & android) and Expo publish error 我怎样才能解决这个问题? 如果我使用expo应用程序在android上模拟它,我的应用程序工作正常,但是当我构建apk时它崩溃了 - How can I fix this? My app works fine if I use expo app to emulate it on android, but it crashes when I build the apk 如何修复Android中的glUseProgram错误 - How do I fix glUseProgram error in Android 在 React Native 上运行 Android Build 时出错 - Error While Running Android Build On React Native Android - 运行应用程序时生成失败错误 - Android - Build Failed error While Running an App 如何在使用“classpath”com.android.tools.build:gradle:2.3.3&#39;时修复build.gradle错误 - How to fix build.gradle error while using “ classpath 'com.android.tools.build:gradle:2.3.3' ” 如何在Jenkins上编译Android项目时修复此ZipException? - How do I fix this ZipException while compiling an Android project on Jenkins?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM