To build the project, you will need to have Android Studio version 2024.1.1 or higher. The embedded version of Java should be version 17 or higher.
- Install Android Studio. You can download the latest version from the official Android Studio website.
- Ensure that Java 17 is used in Android Studio. You can verify this in the studio settings under File → Project Structure → SDK Location.
The project includes two key dependencies that need to be integrated for correct functionality:
- blockchain-sdk — a library for interacting with a blockchain system.
- tangem-sdk — SDK for working with Tangem cards and interacting with their API.
Both dependencies are pulled from GitHub Package Registry.
-
To download dependencies from GitHub Registry, you need to generate a personal access token on GitHub:
- Go to GitHub Settings → Developer settings → Personal access tokens.
- Create a new token with the required access (e.g.,
read:packages
to read from the registry).
-
After that, you need to add the token to the
local.properties
file of your project for authentication:- Open the
local.properties
file at the root of your project (create it if it doesn't exist). - Add the following lines:
gpr.user=YOUR_GITHUB_USERNAME gpr.key=YOUR_GENERATED_TOKEN
- YOUR_GITHUB_USERNAME — your GitHub username.
- YOUR_GENERATED_TOKEN — the token you generated in the previous step.
- Open the
-
Once this is done, the dependencies will be automatically downloaded during the build process via Gradle.
You need to add the google-services.json
file to the /app
folder of your project for Firebase services and Google APIs to work properly.
-
Go to the Firebase Console.
-
Create a new project or select an existing one.
-
Use the package name
com.tangem.wallet.debug
when setting up your Firebase project for Android. -
Download the
google-services.json
file:- Add an Android app to the Firebase project.
- Download the
google-services.json
file.
-
Place the
google-services.json
file inside the/app
folder of your project.
Create the following folder structure in your project.
Inside this folder, place the config_dev.json
file.
- Create the
tangem-app-config
folder underapp/src/main/assets
. - Place the
config_dev.json
file into thetangem-app-config
folder.
Once all the previous steps are completed, you need to sync your Gradle files and run the build.
- In Android Studio, go to the File menu and select Sync Project with Gradle Files.
- Once the sync is complete, you can build the project by selecting Build → Make Project or pressing Ctrl+F9 (Windows/Linux) or Cmd+F9 (macOS).
- Ensure there are no errors in the Build Output and that the project is successfully built.