GoSDK for mobile builds (iOS and Android)
Setup gomobile
GoSDK can be built to use on mobile platforms iOS and Android using gomobile. To setup gomobile environment :
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:
Now to install and intialize gomobile package
Run below command inside the gosdk directory for the first time to setup gomobile environment
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
Now, let's build the Mobile SDK
For Android :Android studio with NDK and JDK is required to build SDK for Android.
For iOS: Xcode Command Line Tools is required to build SDK for iOS.
Commands for building mobilesdk are below :
Sample Response for android :
Sample Response for iOS:
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 troubleshooting section below .
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)
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)
Last updated