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.

Error: ./configureAndroidSdk.sh exited with non-zero code: 1 on android setup

See original GitHub issue

New Issue Checklist

  • Updated turtle-cli to the latest version (yarn global add turtle-cli or npm install --global turtle-cli).
  • I read the Contribution Guidelines.
  • I read docs.expo.io (Managed Workflow > Distributing Your App).
  • I searched for existing GitHub issues.
  • I enclosed the complete output when running turtle, including the stack trace and command used.

Issue Description

configureAndroidSdk.sh exited with non-zero code when I tried to run turtle setup:android.

Edit: Already tried reinstalling turtle, node and expo and still fails

Command executed

turtle setup:android

Complete output when running turtle, including the stack trace and command used
Oct 25 09:39:38 turtle[7814] INFO:  Downloading Android SDK
  platform: "android"
  buildPhase: "setting up environment"
downloading [=================== ] 95% 0.6sOct 25 09:39:52 turtle[7814] INFO:  Decompressing Android SDK
  platform: "android"
  buildPhase: "setting up environment"
Oct 25 09:39:54 turtle[7814] INFO:  Configuring Android SDK, this may take a while
  platform: "android"
  buildPhase: "setting up environment"
Oct 25 09:39:55 turtle[7814] INFO:  Exception in thread "main" 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      ... 5 more
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Exception in thread "main" 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      ... 5 more
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Exception in thread "main" 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      ... 5 more
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Exception in thread "main" 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      ... 5 more
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Exception in thread "main" 
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:  Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] INFO:      ... 5 more
  platform: "android"
  buildPhase: "setting up environment"
  source: "stderr"
Oct 25 09:39:55 turtle[7814] ERROR: Failed to setup environment for android builds
  err: Error: ./configureAndroidSdk.sh exited with non-zero code: 1
      at ChildProcess.completionListener (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:65:13)
      at Object.onceWrapper (events.js:300:26)
      at ChildProcess.emit (events.js:210:5)
      at ChildProcess.EventEmitter.emit (domain.js:476:20)
      at maybeClose (internal/child_process.js:1021:16)
      at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
      ...
      at spawnAsync (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/node_modules/@expo/spawn-async/src/spawnAsync.ts:26:19)
      at Object.spawnAsyncThrowError (/@expo/xdl@56.2.2-alpha.2/src/detach/ExponentTools.ts:131:19)
      at _configureSdk (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:54:23)
      at Object.ensureAndroidSDKIsPresent [as default] (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/setup/android/sdk.ts:34:7)
      at prepareAndroidEnv (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:56:21)
      at Object.setup [as default] (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/setup/android/index.ts:44:3)
      at Object.setup [as default] (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/setup/setup.ts:15:12)
      at setupAction (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:33:5)
      at /home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/commands/setup.ts:22:40
      at Command.<anonymous> (/home/rodrigob/.nvm/versions/node/v12.12.0/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
  platform: "android" 

Environment

  Expo CLI 3.4.1 environment info:
    System:
      OS: Linux 4.4 Ubuntu 16.04.6 LTS (Xenial Xerus)
      Shell: 4.3.48 - /bin/bash
    Binaries:
      Node: 12.12.0 - ~/.nvm/versions/node/v12.12.0/bin/node
      Yarn: 1.17.3 - /usr/bin/yarn
      npm: 6.11.3 - ~/.nvm/versions/node/v12.12.0/bin/npm
      Watchman: 4.7.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
    npmPackages:
      expo: ^35.0.0 => 35.0.0 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 
      react-navigation: ~3.11.0 => 3.11.3 
    npmGlobalPackages:
      expo-cli: 3.4.1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
BrickmanRodrigocommented, Oct 25, 2019

Yeah, I was just looking into that, my $JAVA_HOME was pointing to the java 11 directory. I changed it to the java 8 directory and it works fine.

Thanks for your help!

EDIT: Forgot to mention, I removed the $JAVA_OPTS env variable as it was giving me the error mentioned before. When I did it worked fine

3reactions
dsokalcommented, Oct 25, 2019

Could you please run one more command? $JAVA_HOME/bin/java -version

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android building issue: No space left on device
But we have the issue with Android as below. We have that issue as ... configureAndroidSdk.sh exited with non-zero code: 1 at ChildProcess....
Read more >
React Native Expo Build APK using Turtle CLI - Stack Overflow
... turtle[5136] ERROR: Failed to setup environment for android builds err: Error: ./configureAndroidSdk.sh exited with non-zero code: 1 at ChildProcess.
Read more >
React Native Failed Building Expo APK using Turtle CLI
_ERROR: Failed to setup environment for android builds err: Error: ./configureAndroidSdk.sh exited with non-zero code: 127_**.
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