Local build with turtle-cli fails with "Cannot read property 'android' of undefined"


#1

Just getting this set up, so maybe I’m missing something but trying to get Android building on my local machine.

On Mac OSX Mojave. Ran the following to set up:

yarn global add turtle-ci

# Install Java 8
brew tap caskroom/versions
brew cask install java8

# Install gulp CLI
yarn global add gulp-cli

turtle setup:android --sdk-version 30.0.0

And finally:

turtle build:android --username <USERNAME> --password <PASSWORD>

Output was:

Dec 2 06:21:39 turtle[28035] INFO:  Creating keystore
  buildPhase: "generating keystore"
Dec 2 06:21:39 turtle[28035] ERROR: Failed to build standalone app: Cannot read property 'android' of undefined
Dec 2 06:21:39 turtle[28035] ERROR: TypeError: Cannot read property 'android' of undefined
    at Object.getOrCreateCredentials [as default] (/Users/jason/.config/yarn/global/node_modules/turtle-cli/src/builders/utils/android/credentials.ts:22:45)
    at buildAndroid (/Users/jason/.config/yarn/global/node_modules/turtle-cli/src/builders/android.ts:18:29)
    at /Users/jason/.config/yarn/global/node_modules/turtle-cli/src/bin/utils/builder.ts:69:13

Ideas? Don’t really know where to go from here. Thanks.


#3

The error message isn’t terribly helpful, but I managed to solve by re-reading the instructions several times.

I had to do an initial build via Expo first, which I was trying to avoid. This let me generate a keystore.

expo build:android

Fetched keystore:

expo fetch:android:keystore

Added the following to my environment vars:

EXPO_ANDROID_KEYSTORE_PASSWORD=abc123
EXPO_ANDROID_KEY_PASSWORD=123abc

Then finally:

turtle build:android --username <USERNAME> --password <PASSWORD> --keystore-path <KEYSTORE.jks> --keystore-alias <ALIAS>

Whew. Maybe that’s useful to someone else.


closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.