Install Android SDK
To configure Android for Flutter, follow these steps:
- Add GitHub Maven credentials to your project's build file.
- If your app uses
android/build.gradle.kts
(Kotlin), add the following block to theallprojects
>repositories
section:allprojects { repositories { // ... other repositories maven { url = uri("https://maven.pkg.github.com/Capillary/hydra-sdk-android-maven") credentials { username = System.getenv("HYDRA_GITHUB_USER_NAME") password = System.getenv("HYDRA_GITHUB_PAT") } } } }
- If your app uses
android/build.gradle
(Groovy), add the following block to theallprojects
>repositories
section:allprojects { repositories { // ... other repositories maven { url "https://maven.pkg.github.com/Capillary/hydra-sdk-android-maven" credentials { username System.getenv("HYDRA_GITHUB_USER_NAME") password System.getenv("HYDRA_GITHUB_PAT") } } } }
- If your app uses
- Update the Application class name in your
android/app/src/main/AndroidManifest.xml
. By default, Flutter apps do not use a custom Application class in Android, but the SDK requires one for initialization. Find the tag and set its android:name attribute to "com.capillary.plugins.hydra.HydraApplication" as shown in this example:<application android:name="com.capillary.plugins.hydra.HydraApplication" ...> </application>
Note
If you are using your own Application class or plan to use another CMS, follow the steps in the Advanced Android setup documentation instead of this step.
- Set an
AppCompat
theme for your application in yourAndroidManifest.xml
. The SDK requires that your application theme is set to an AppCompat theme. If your app's theme is not already set to anAppCompat
theme, add or update theandroid:theme
attribute within the tag as shown in this example:<application ...> android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" > </application>
Updated 1 day ago