Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process 'command '/Users/userA/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 134 #20

Open
EddieMeng opened this issue Jul 4, 2021 · 15 comments

Comments

@EddieMeng
Copy link

EddieMeng commented Jul 4, 2021

Hello, I'm very appreciated the swift-android toolchain you guys built. So I want to build and run this project personally, after set up the environment like the project said (https://github.com/readdle/swift-android-toolchain) , when I started build this project, I meet this error: Process 'command '/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 134. I fail to resolve this issue after many attempts, so here I come to ask you help, could you help me to check what's went wrong.

I list all the related information below:

  1. MacOS Version: Catalina version 10.15.4
  2. Android Studio Version: 4.2.2
  3. Gradle Version: 6.7.1, Android Studio Gradle plugin Version: 4.2.0
  4. swift-android-toolchain: 5.0-r13

Here is the build error I meet:

Task :app:installSwiftTools
Installing Swift Build Tools v1.9.6-swift5
fatal: unable to access 'https://github.com/readdle/swift-android-buildtools/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Swift Build Tools v1.9.6-swift5 installed

Task :app:swiftBuildArm64Debug FAILED
Swift PM flags: --configuration debug -Xswiftc -DDEBUG EMBEDDED_CONTENT_CONTAINS_SWIFT=YES
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/userA/swift-android-5.0-r13/toolchain/usr/bin/swift-build
Reason: image not found
/Users/userA/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build: line 58: 3229 Abort trap: 6 $SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh) $flags "$@"

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:swiftBuildArm64Debug'.

Process 'command '/Users/userA/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 134

Here is my environment variable setting in case you want to check it.
Screen Shot 2021-07-05 at 01 13 36

I'm looking forward for your reply

@andriydruk
Copy link
Owner

Hi,

  1. Do you install the proper version of swift on your mac?
[IMPORTANT] Install Swift 5.0.3 toolchain for Xcode https://swift.org/builds/swift-5.0.3-release/xcode/swift-5.0.3-RELEASE/swift-5.0.3-RELEASE-osx.pkg

I don't see export TOOLCHAINS=org.swift.50320190830a in your environment setup
Looks like you try to use the android toolchain with your current XCode Swift 5.4. Please follow instructions from the readme.

  1. Also, it's weird that you can't clone our project from Github
fatal: unable to access 'https://github.com/readdle/swift-android-buildtools/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Please try to clone in separately:

git clone https://github.com/readdle/swift-android-buildtools

Seems like you have some SSL issues on your machine.

@EddieMeng
Copy link
Author

Hello, I did set export TOOLCHAINS=org.swift.50320190830a, but the screenshot above is not complete, here is the completed info

export TOOLCHAINS=org.swift.50320190830a

NDK=17c
export ANDROID_NDK_HOME=/Users/Eddie/Downloads/Android/NDK/android-ndk-r$NDK

export NDK_ROOT=$ANDROID_NDK_HOME
export ANDROID_NDK=$ANDROID_NDK_HOME
export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME

export SWIFT_ANDROID_HOME=$HOME/android/swift-android-current
export PATH=$ANDROID_NDK_HOME:$PATH
export PATH=$SWIFT_ANDROID_HOME/bin:$SWIFT_ANDROID_HOME/build-tools/current:$PATH

OH, yes, I have no idea why I got the ssl issue, but looks like the log tell me swift build tools completed regardless of the ssl issue
fatal: unable to access 'https://github.com/readdle/swift-android-buildtools/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Swift Build Tools v1.9.6-swift5 installed

@EddieMeng
Copy link
Author

EddieMeng commented Jul 4, 2021

I found that ssl issue is the network issue, the latest build info don't report the ssl issue again

Task :app:installSwiftTools
Installing Swift Build Tools v1.9.6-swift5
Swift Build Tools v1.9.6-swift5 installed

Task :app:swiftBuildArm64Debug FAILED
Swift PM flags: --configuration debug -Xswiftc -DDEBUG
dyld: Library not loaded: @rpath/libswiftCore.dylib
Referenced from: /Users/userA/swift-android-5.0-r13/toolchain/usr/bin/swift-build
Reason: image not found
/Users/userA/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build: line 58: 5412 Abort trap: 6 $SWIFT_ANDROID_HOME/toolchain/usr/bin/swift-build --destination=<($SELF_DIR/generate-destination-json.sh) $flags "$@"

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:swiftBuildArm64Debug'.

Process 'command '/Users/userA/swift-android-5.0-r13/build-tools/1.9.6-swift5/swift-build'' finished with non-zero exit value 134

By the way I build this project by this command: ./gradlew aseembleDebug, is that okay?
@andriydruk

@andriydruk
Copy link
Owner

Yes, it's ok. We use Gradle build in our CI

Toolchain somewhy can't find your swift installation
Could you check your swift version?

swift --version

@EddieMeng
Copy link
Author

Screen Shot 2021-07-05 at 00 54 52

please check @andriydruk

@EddieMeng
Copy link
Author

is it matter with the mac os version, what's your build server mac os version? I don't have clue about why this build error occur. @andriydruk

@andriydruk
Copy link
Owner

Hmm, the swift version looks ok.
It should work with BigSur and Catalina. We use macos-latest on Github CI which is Catalina for now https://github.com/actions/virtual-environments

Maybe try to clean up the project/environment. Check our CI script maybe it will help you
https://github.com/andriydruk/swift-weather-app/blob/master/.github/workflows/android-ui.yml

@EddieMeng
Copy link
Author

Is your build server build the app by android studio or just gradle? and by the way, what the CI software are you using? @andriydruk

@EddieMeng
Copy link
Author

I wanna confirm that is this project build by the github CI server?

@andriydruk
Copy link
Owner

We use Gradle in this CI script. But should work with Android Studio as well.
And yes it's public Github CI without any priority servers
https://docs.github.com/en/actions

@EddieMeng
Copy link
Author

@andriydruk Hello andriydruk, thanks for your patient help. I tried the script in github server, it did build successfully. But when I tried to build the project in two different mac os machines, both met this error. Besides, I think I'm not the only one met this error refer to
readdle/swift-android-toolchain#20 , so it is probably a common issue in local build. I wanna know had this project ever built successfully in your guys mac os machine? so that I can figure out what went wrong.

@EddieMeng
Copy link
Author

Sir, any update on this? @andriydruk

@andriydruk
Copy link
Owner

I have one more assumption: maybe problem with the macOS version. In Readdle everybody uses the latest version of Big Sur.
Github CI provides macOS 10.15.7 and macOS 11.4
I will add one more CI script to double-check that everything works on both Catalina and Big Sur

@EddieMeng
Copy link
Author

@andriydruk Sir, your assumption is correct, after I upgrade the system to latest version of Big Sur, I built the app successfully. I'm very appreciated this toolchain your guys created, the idea is awesome, please keep making it better and better. Besides, I am a fans of Spark email, which is powerful and intelligent, saving me lots of time. is the toolchain was applied in all the projects in Readdle?

@andriydruk
Copy link
Owner

@EddieMeng thank you for so warm words! We do our best to provide a good experience for all our users. And we are glad to share our expertise with the developer community.

Currently, we use the Swift Android toolchain only in Spark because it's the only Readdle's app on the Android platform 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants