Let's get the code compiling successfully on your machine.
Note: It's assumed that you have Android Studio installed on your machine before continuing
- Clone the git repo to your computer.
- Open Android Studio > Select "Import Project (Gradle...)" > then choose the root directory of the code (you will see
app/andsdk/directories).
- Android Studio should walk you through installing the correct Android SDK for the code base.
If all went well, you should be able to build the Example app within Android Studio. This is a good sign you're setup correctly.
Now that you have gotten the app to successfully compile, it's time for you to finish setting up the rest of your development environment.
- Setup git hooks using the tool lefthook:
$ brew install lefthook
$ lefthook install
SYNCING
SERVED HOOKS: pre-commit, prepare-commit-msg
See LINT to learn more about linting in this project.
See file GIT-WORKFLOW to learn about the workflow that this project uses.
See file GIT-WORKFLOW to learn about how code is deployed in this project.
To setup the CI server to make the deployments, follow these steps: Create GitHub Actions secrets:
GRADLE_PUBLISH_USERNAME- set the value to Sonatype Jira username to push to Sonatype repository.GRADLE_PUBLISH_PASSWORD- set the value to Sonatype Jira password.GRADLE_SIGNING_KEYID- The signing plugin says "The public key ID (The last 8 symbols of the keyId. You can use gpg -K to get it)." The important part there is the last 8 characters of the keyid. Use commandgpg --list-secret-keys --keyid-format longand the last 8 characters of the[S]subkey's keyId is the value of this environment variable. So if the key is woijeyrinvnno22o2n, you will set nno22o2n as the value on your CI server.GRADLE_SIGNING_PRIVATE_KEY- This is the secret subkey in armor format. On your machine, rungpg --export-secret-subkeys --armor -o /tmp/subkeys.key XXXXXXXXXXXXXXXX(where XXX is the master key ID). You will enter the passphrase for your master key and then your subkeys will be generated to the output file. Now, you can runcat /tmp/subkeys.keyto get the contents of this environment variable. Note: If you don't want to sign with subkeys but instead master key, you would use --export-secret-keys instead of --export-secret-subkeys for the above command but everything else stays the same with the command.GRADLE_SIGNING_PASSPHRASE- this is your master key GPG passphrase.SLACK_NOTIFY_RELEASES_WEBHOOK_URL- create an incoming webhook URL to be able to send messages to a channel in your Slack workspace. Learn more.
- Follow the development workflow as described in this document. You will be making pull requests and once those are merged, the CI server will automatically execute and deploy for you.
This project is setup with GPG signing to sign the Maven artifacts before they are uploaded to Sonatype's servers to sync to Maven Central. GPG keys have been generated already but if you need to generate them again, see this guide to do so.
A production release publishes eight modules. Each module contains the binary, sources, Javadocs, Gradle module metadata, and POM, together with a PGP signature for each file.
Gradle 8 normally adds MD5, SHA-1, SHA-256, and SHA-512 checksum sidecars to every artifact and
signature during a remote Maven publication. That expands the ten publication files per module to
fifty files, or 400 files for a complete SDK release. Sonatype's publishing usage guidance
notes that additional generated checksum files are generally not required. The
Gradle compatibility flag
in gradle.properties disables SHA-256 and SHA-512 sidecars while retaining MD5, SHA-1, and all
PGP signatures. The expected remote publication is therefore thirty files per module, or 240
files for a complete SDK release.
Do not remove source jars, Javadoc jars, POMs, signatures, or Gradle module metadata solely to reduce this count. They are required by Maven Central or used by Gradle consumers. Review the calculation whenever the set of publishable modules or attached artifacts changes.
This section explains how to publish the SDK locally to Maven Local. This could be useful in couple of scenarios:
- If you want to verify that the SDK binary publishing works without errors locally without actually publishing any versions
- Testing your changes in one of your wrapper SDKs (ReactNative, Expo or Flutter) with local changes
To publish the SDK locally, you can run the following command:
IS_DEVELOPMENT=true ./gradlew publishToMavenLocalThis will publish a local version to Maven Local called 'local', that you can use for wrapper SDKs.
To validate the published artifacts as an external Android application would consume them, force
both sample apps to resolve the local Maven coordinates instead of their normal project
dependencies, then build both debug and minified release APKs:
./gradlew \
:samples:java_layout:assembleDebug \
:samples:java_layout:assembleRelease \
:samples:kotlin_compose:assembleDebug \
:samples:kotlin_compose:assembleRelease \
-PcioSDKVersion=localThis exercises dependency metadata, transitive dependencies, consumer ProGuard rules, SDK APIs, and Android resource packaging from the published Maven artifacts.
For known local setup issues and fixes, see TROUBLESHOOTING.md.

