☁️
Züs
  • About Züs
  • Concepts
    • Architecture
      • Mining on the Züs Blockchain
        • Onboarding a New Miner or Sharder
        • Block Production Protocol
        • Block Finalization
        • Merkle Patricia Trees(MPT) and Recovery
        • View Change and Distributed Key Generation(DKG)
      • Payment
      • Storage
      • Token Bridge Protocol
      • Resources
    • Tokenomics
      • Staking Process
      • Block Rewards
      • Delegation
    • Store
    • Earn
    • Build
    • NFT
  • Resources
    • Whitepapers
      • Tokenomics Paper
      • Architecture Paper
      • Storage Paper
    • Patents
      • NON-FUNGIBLE TOKEN BLOCKCHAIN PROCESSING
      • FREE STORAGE PROTOCOL FOR BLOCKCHAIN PLATFORM
      • TRANSFERRING CONTENT VIA PROXY RE-ENCRYPTION
      • STREAMING CONTENT VIA BLOCKCHAIN TECHNOLOGY
      • SPLIT-KEY WALLET ACCESS BETWEEN BLOCKCHAINS
      • ENFORCING SECURITY PARAMETERS SPECIFIED BY AN OWNER ON A BLOCKCHAIN PLATFORM
      • CLIENT AUTHENTICATION USING SPLIT KEY SIGNING ON A BLOCKCHAIN PLATFORM
      • BLOCKCHAIN CONTENT PURCHASING PROTOCOL
      • BLOCKCHAIN BASED PRIVACY COMPLIANCE PLATFORM
      • SYSTEMS AND METHODS OF SELF-ADMINISTERED PROTOCOLS ON A BLOCKCHAIN PLATFORM
      • SYSTEMS AND METHODS OF AGGREGATE SIGNING OF DIGITAL SIGNATURES ON MULTIPLE MESSAGES SIMULTANEOUSLY U
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR AUTOMATED ASSET BASED PROVISIONING OF RESOURCES
      • SYSTEMS AND METHODS OF SELF-FORKING BLOCKCHAIN PROTOCOL
      • SYSTEMS AND METHODS OF SUSTAINABILITY PROTOCOL USING DISTRIBUTED BLOCKCHAIN APPLICATION WITH IoT SEN
      • SYSTEMS AND METHODS OF BLOCKCHAIN PLATFORM FOR DISTRIBUTED APPLICATIONS
  • API Reference
    • Endpoints
      • Block
      • Client
      • Connection
      • DNS
      • File
      • Smart Contracts
      • Blobber Stats
      • Transactions
      • Miners and Sharders
        • Stats
        • State
        • Diagnostics
        • Configuration
        • Smart Contract State
        • Smart Contract Stats
        • Chain Stats
  • Hackathon
    • Register to Hackathon
      • How to Add Members to Hackathon Team
    • Repos
    • Documentation
  • Products
    • Bolt
      • Get Started
      • Stake
      • Activity
      • Buy ZCN
      • Sell ZCN
      • Send Tokens
      • Receive Tokens
      • Settings
        • Manage Profile
        • Wallet
        • Read Pool
      • Troubleshooting
    • Vult
      • Sign Up
      • Upload File
      • Upload an Encrypted File
      • Upload a File to a Folder
      • Share a Uploaded File
      • Move a Uploaded File
      • Delete a File
      • Make File Available Offline
      • Troubleshooting
    • Atlus
      • Dashboard Overview
      • Service Providers
      • Charts
        • Market Charts
        • Network Charts
        • Storage Charts
        • Züs Explainer
      • Blockchain
      • Server Map
    • Blimp
      • Sign Up
        • Buy ZCN for Storage
      • Use Blimp as Direct Storage
      • Use Blimp as S3 Server
        • S3 Operations
      • Use Blimp for Cloud Migration
      • Manage Allocations
        • Extend Size
        • Extend Duration
        • Add Blobber
        • Replace Blobber
        • Make allocation Immutable
        • Freeze Allocation
        • Cancel Allocation
    • Chimney
      • Get Started
      • Deploy Blobber on Own Server
      • Deploy Blobber on Rented Server
      • Stake Blobber
      • Add Blobber
      • Monitor Blobbers
      • Visualize Blobber Logs
      • View Blobber Rank
    • Chalk
      • Sign Up
      • Create NFT Collection
        • Buy ZCN for NFT via ERC token
        • Buy ZCN for NFT via Credit card
      • Explore NFT Collections
      • My NFTs
      • Profile
        • Withdraw Earnings
        • Manage Collections
  • Guides
    • Zus GO SDK
    • Zus JS SDK
    • Zbox CLI
      • Repo
      • Get Started
      • Creating and Managing Allocations
      • Uploading and Managing Files
      • Lock and Unlock Tokens
      • Tips and Troubleshooting
    • Zwallet CLI
      • Repo
      • Get Started
      • Zwallet Operations
      • Staking on miners and sharders
      • Burn and Mint Tokens using Zwallet
      • Troubleshooting
    • Add a Blobber
      • Repo
      • Getting Started
    • Add a Miner/Sharder
      • Repo
      • Getting Started
    • Setup a Blockchain
      • Repo
      • Quickstart
        • Understand the Script
      • Step 1: Set up the project
      • Step 2: Setup the network for Züs components
      • Step 3: Initialize and Build the Züs components
      • Step 4: Start Sharder and Miner Containers
      • Step 5 : Create a wallet using zwalletcli
      • Step 6: Starting the blobber containers
      • Step 7: Validate Züs deployment
      • Step 8: Creating an Allocation on Blobber
      • Restarting Sharder and Miner Containers with CleanDB.
      • Additional Tips and Troubleshooting
    • Glossary
  • Support
    • Help Center
      • Community
      • Issues on Github
      • Contact Us
Powered by GitBook
On this page
  • Setup gomobile
  • Build Mobile SDK
  • Troubleshooting
  1. Guides
  2. Züs GoSDK

GoSDK for mobile builds (iOS and Android)

Last updated 1 year ago

Setup gomobile

GoSDK can be built to use on mobile platforms iOS and Android using gomobile. To setup gomobile environment :

  1. Make sure $HOME/go/bin/ is in your $PATH. If it's not, edit your bash profile to add it. Your profile is a file in your home directory named either .profile or .bash_profile. It should contain a line like this:

export PATH=${PATH}:$HOME/go/bin/
  1. Now to install and intialize gomobile package

go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
  1. Run below command inside the gosdk directory for the first time to setup gomobile environment

  make setup-gomobile

Sample Response: ​ ​Initializing gomobile. Please wait it may take a while ... ​ ------------------------------------------------------------ ​ go: downloading golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023 ​ go: downloading golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57 ​ go: downloading golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df ​ go: downloading golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab ​​

Build Mobile SDK

  1. Now, let's build the Mobile SDK

For Android : with and is required to build SDK for Android.

For iOS: is required to build SDK for iOS.

  1. Commands for building mobilesdk are below :

   For iOS only:       make build-ios  
For Android only:     make build-android  

Sample Response for android :

jar: zcncore/Zcncore.java
   C:/Users/0chain/Desktop/gosdk/out/androidsdk/zcncore.aar. - [OK]

Sample Response for iOS:

xcframework successfully written out to: 
/Users//gosdk/out/iossdk/ios/zcncore.xcframework   
/Users/0chain/gosdk/out/iossdk/ios/zcncore.xcframework. - [OK]

Troubleshooting

1. Java Development Kit(JDK) path has to be set to build libraries for Android with out any errors. Here is the command for setting JDK path (replace it with path where JDK is installed on your system)

set path = "%path%;c:program files\java\jdk1.7.0\bin"

2. NDK has to be properly installed for building libraries on Android. To check it go to Android Studio > File > Project Structure...> Make sure the directory path includes the version number for NDK (e.g. C:\Users...\ndk\21.3.6528147)

The response will successfully build a library file which includes everything needed to build a Züs mobile app, including source code and resource files. Now you can use the library into your own iOS or Android project. In case of build errors check section below .

Android studio
NDK
JDK
Xcode Command Line Tools
troubleshooting