Skip to content

Instantly share code, notes, and snippets.

@wtogami
Last active February 1, 2017 12:17
Show Gist options
  • Save wtogami/2fde99562fa38f789b9bdcf8c93c8e4a to your computer and use it in GitHub Desktop.
Save wtogami/2fde99562fa38f789b9bdcf8c93c8e4a to your computer and use it in GitHub Desktop.
Building the Bitcoin Android for Android on Fedora on the command line as a fresh non-root user
### Building the Bitcoin Wallet for Android on Fedora on the command line as a fresh non-root user ###
# This uses sdkmanager instead of the GUI Android SDK IDE
# These instructions may need to be slightly modified for newer versions of the tools required to build the target application.
# 1. Install javac and related tools: dnf install java-1.8.0-openjdk-devel
# TODO: This may not be enough tools... look into this later.
# 2. Create a new non-root user and login
# 3. Download these packages and put them into /tmp
# https://services.gradle.org/distributions/gradle-2.10-bin.zip from https://gradle.org/gradle-download/
# https://dl.google.com/android/repository/tools_r25.2.3-linux.zip from https://developer.android.com/studio/index.html
# 4. Unpack tools
cd ~/
unzip /tmp/gradle-2.10-bin.zip
mkdir android_sdk
cd android_sdk
unzip /tmp/tools_r25.2.3-linux.zip
cd tools/bin
# Use sdkmanager to update itself
./sdmanager --update
# Exit and enter the directory again
cd ../bin/
# Install tools needed to build Bitcoin Wallet for Android
./sdkmanager 'build-tools;25.0.1' 'extras;android;m2repository' 'ndk-bundle' 'platform-tools' 'platforms;android-15' 'platforms;android-25' 'tools'
# Add these to ~/.bashrc then restart your shell
export PATH=~/gradle-2.10/bin:$PATH
export ANDROID_HOME=~/android_sdk
export ANDROID_NDK_HOME=~/android_sdk/ndk-bundle
# Restart your shell so the environment variables take effect
git clone https://github.com/bitcoin-wallet/bitcoin-wallet.git
cd bitcoin-wallet/
gradle clean build
### Build Automation Note: Build requires X DISPLAY to work, may require fake Xephyr server to automate a headless build process
:wallet:mergeDebugResources
java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.
:wallet:mergeDebugResources FAILED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment