- Open your Unity project.
- Go to
Unity -> Assets -> Import Package
.
- Select the downloaded SDK package.
- Click on
All
in the import menu, then selectImport
. This will add the Appcharge SDK code to your project.
Adding AppCharge's Dependencies
To add Appcharge's SDK Android dependencies to your project, you have to add a custom mainTemplate.gradle
to your project.
- Enable Custom Gradle Template
Skip this if you already have a mainTemplate.gradle
file in your project
Go to Player Settings > Android > Publishing Settings > Build > Custom Main Gradle Template
, and mark the checkbox true.
- Add Dependencies to
mainTemplate.gradle
Add the following code to your project mainTemplate.gradle
file, under dependencies
:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
implementation("androidx.browser:browser:1.3.0") {
exclude group: 'androidx.browser', module: 'browser'
}
}
Please note that if Android Auto Resolver is activated, it might manipulate this file.