question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android build fails on local build

See original GitHub issue

hi,

i try to build an android app locally on gitlab. but i get a general bug i can’t do anything with. on the public expo server the app can be built successfully.

When building the system i followed the following documentation:

I hope you can help me and thank you for your time!

Dockerfile

FROM ubuntu:bionic

RUN apt-get update && apt-get install -y sudo curl && \
    curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
    curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \
    apt-get update && \
    apt-get install -y jq yarn nodejs wget ruby-dev gcc g++ make python build-essential openjdk-8-jdk-headless git && \
    gem install fastlane

RUN npm install -g turtle-cli gulp-cli expo-cli --unsafe-perm=true --allow-root

Build Steps

# tried both
SDK_VERSION=37.0.0
SDK_VERSION=36.0.0

# bundle and deploy to web
yarn install
expo export --public-url https://expo.benkner-it.de

# deploy to https://expo.benkner-it.de
rm -rf /share/*
cp -rf dist/* /share/

# build app
turtle setup:android --sdk-version $SDK_VERSION
turtle build:android --type apk --keystore-path ./debug.keystore --keystore-alias "keyalias" --public-url https://expo.benkner-it.de/android-index.json

Error

 May 4 19:52:28 turtle[510] ERROR: Error: ./gradlew exited with non-zero code: 1
     at ChildProcess.completionListener (/usr/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
     at Object.onceWrapper (events.js:417:26)
     at ChildProcess.emit (events.js:310:20)
     at ChildProcess.EventEmitter.emit (domain.js:482:12)
     at maybeClose (internal/child_process.js:1021:16)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
     ...
     at spawnAsync (/usr/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
     at spawnAsyncThrowError (/@expo/xdl@57.8.30/src/detach/ExponentTools.ts:100:19)
     at buildShellAppAsync (/@expo/xdl@57.8.30/src/detach/AndroidShellApp.js:1290:11)
     at Object.createAndroidShellAppAsync (/@expo/xdl@57.8.30/src/detach/AndroidShellApp.js:345:5)
     at runShellAppBuilder (/usr/lib/node_modules/turtle-cli/src/builders/android.ts:91:5)
     at buildAndroid (/usr/lib/node_modules/turtle-cli/src/builders/android.ts:23:26)
     at /usr/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:87:7
     at Command.<anonymous> (/usr/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
   platform: "android"
 May 4 19:52:28 turtle[510] ERROR: Failed to build standalone app
   err: Error: ./gradlew exited with non-zero code: 1
       at ChildProcess.completionListener (/usr/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
       at Object.onceWrapper (events.js:417:26)
       at ChildProcess.emit (events.js:310:20)
       at ChildProcess.EventEmitter.emit (domain.js:482:12)
       at maybeClose (internal/child_process.js:1021:16)
       at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
       ...
       at spawnAsync (/usr/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
       at spawnAsyncThrowError (/@expo/xdl@57.8.30/src/detach/ExponentTools.ts:100:19)
       at buildShellAppAsync (/@expo/xdl@57.8.30/src/detach/AndroidShellApp.js:1290:11)
       at Object.createAndroidShellAppAsync (/@expo/xdl@57.8.30/src/detach/AndroidShellApp.js:345:5)
       at runShellAppBuilder (/usr/lib/node_modules/turtle-cli/src/builders/android.ts:91:5)
       at buildAndroid (/usr/lib/node_modules/turtle-cli/src/builders/android.ts:23:26)
       at /usr/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:87:7
       at Command.<anonymous> (/usr/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
   platform: "android"

Full Log https://storage.googleapis.com/gitlab-gprd-artifacts/32/d0/32d038f01f38b98d5dea5c7dae9ce20acd455f94094fb8d496ad3bee799a0407/2020_05_05/538168899/585582050/job.log?response-content-type=text%2Fplain%3B charset%3Dutf-8&response-content-disposition=inline&GoogleAccessId=gitlab-object-storage-prd@gitlab-production.iam.gserviceaccount.com&Signature=ii%2BY5yHxo8%2Bo4rBr%2FrAI%2Fo1sy%2F37Ktnex5E4rKExB5WnEh8QHE3oagg1FOtl TkxtTg76Iilr8KxOvAdsjR1GfaG48sPhnaO8t1jA6D5BEgRrAQrdKGDbMpdN O1OJUnFeO9AWomtRdaTxy9SPT4EEFBXcbTedQRQ65miA7AM63EY%2F2MUp228H XERENo%2BdFteq6QdREhyV%2Bg%2F4HP%2F2R2E8bvCzF9axChY9DVMY6K%2BRcvjOjtQm i%2FbZkPqI%2FNeqYXo%2BLkrlmmV7Rai9vqUW7lXustT3gchqhjwkp6nQEkRB4HkO JxslBbpjAppHdPKJf61fjTnvbqrAsvrTbczfcLw8vA%3D%3D&Expires=1588661340

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
dsokalcommented, May 7, 2020

This is the command that we use for generating a keystore on our servers:

keytool \
 -genkey \
 -v \
 -storetype JKS \
 -storepass keystore_password \
 -keypass key_password \
 -keystore release.keystore \
 -alias my_key_alias \
 -keyalg RSA \
 -keysize 2048 \
 -validity 10000 \
 -dname "CN=com.domain.like.android.package.name,OU=,O=,L=,S=,C=US"

(reference: https://github.com/expo/expo-cli/blob/master/packages/xdl/src/credentials/AndroidCredentials.ts#L260) The only major difference between your command and ours is that we use the Android package for CN and we leave other fields empty. You use “Tobias Benkner” for CN - and to be honest I’m not sure if it’s valid.

Side note - you shouldn’t be generating a new keystore for every build. Once you upload the app to Google Play Store, you need to sign the further versions of the app with the same keystore.

1reaction
Graham42commented, Sep 24, 2020

In case someone else comes across this. You can convert a PKCS12 keystore to JKS with the following

keytool -importkeystore \
  -srckeystore <source_keystoreFile> \
  -srcstoretype PKCS12 \
  -destkeystore <destination_keystoreFile>  \
  -deststoretype JKS \
  -srcstorepass $KEYSTORE_PASSWORD \
  -deststorepass $KEYSTORE_PASSWORD \
  -srcalias my-alias \
  -destalias my-alias \
  -srckeypass $KEY_PASSWORD \
  -destkeypass $KEY_PASSWORD  \
  -noprompt

Source

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Android build failure with different errors without ...
Reason for Failures : The build failures for Android was due to the publish of the React Native version 0.71. 0-rc0 to Maven...
Read more >
Build fails in android-build@1.0 - Bitrise Discussions
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with...
Read more >
Known issues with Android Studio and Android Gradle Plugin
This error occurs on Linux-based platforms when starting the native debugger. It indicates that one of the libraries required by the native debugger...
Read more >
Android build fails with Android SDK Build-Tools 31.0.0 #1288
The build seems to ignore the pinned Android Build-Tools version. This issue started appearing in our build pipeline between July 19., 13:20 UTC ......
Read more >
Gradle build fails with build tools 31.0.0 - Unity Forum
go to the location "C:\Users\user\AppData\Local\Android\Sdk\build-tools\31.0.0" · find a file named d8.bat. This is a Windows batch file. · rename ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found