Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 41 additions & 3 deletions src/content/add-to-app/android/plugin-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ does (transitively via a plugin).

For instance, your existing app's Gradle might already have:

```groovy title="ExistingApp/app/build.gradle"
<Tabs key="existing-app-dependencies-1">
<Tab name="Kotlin">

```kotlin title="ExistingApp/app/build.gradle.kts"
dependencies {
Expand All @@ -85,6 +88,22 @@ dependencies {
```

</Tab>
<Tab name="Groovy">

```groovy title="ExistingApp/app/build.gradle"
dependencies {
implementation "com.crashlytics.sdk.android:crashlytics:2.10.1"
}
```

</Tab>
</Tabs>

And your Flutter module also depends on
[firebase_crashlytics][] via `pubspec.yaml`:

Expand All @@ -104,7 +123,7 @@ firebase_crashlytics v0.1.3's own [Gradle file][]:
dependencies {
implementation("com.crashlytics.sdk.android:crashlytics:2.9.9")
implementation "com.crashlytics.sdk.android:crashlytics:2.9.9"
}
Expand All @@ -124,16 +143,35 @@ or implementation breaking changes between the versions.
For example, you might use the new Crashlytics library
in your existing app as follows:

<Tabs key="existing-app-dependencies-2">
<Tab name="Kotlin">

```kotlin title="ExistingApp/app/build.gradle.kts"
dependencies {
implementation("com.crashlytics.sdk.android:crashlytics:2.10.1")
}
```

</Tab>
<Tab name="Groovy">

```groovy title="ExistingApp/app/build.gradle"
dependencies {
implementation("com.google.firebase:firebase-crashlytics:17.0.0-beta03")
implementation "com.google.firebase:firebase-crashlytics:17.0.0-beta03"
}
```

</Tab>
</Tabs>

This approach won't work since there are major API differences
between the Crashlytics' Gradle library version
v17.0.0-beta03 and v2.9.9.
Expand Down
19 changes: 18 additions & 1 deletion src/content/packages-and-plugins/using-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,31 @@ Gradle build logic instead.
To force the use of `guava` version `28.0`, make the following
changes to the app's `android/build.gradle` file:

```groovy
<Tabs key="android-conflict-resolution">
<Tab name="Kotlin">

```kotlin title="android/app/build.gradle.kts"
configurations.all {
resolutionStrategy {
force("com.google.guava:guava:28.0-android")
}
}
```

</Tab>
<Tab name="Groovy">

```groovy title="android/app/build.gradle"
configurations.all {
resolutionStrategy {
force 'com.google.guava:guava:28.0-android'
}
}
```

</Tab>
</Tabs>

CocoaPods doesn't currently offer dependency
override functionality.

Expand Down
36 changes: 34 additions & 2 deletions src/content/perf/deferred-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,32 @@ Add Play Core to the Android app's
build.gradle dependencies.
In `android/app/build.gradle` add the following:

```groovy
<Tabs key="android-play-core">
<Tab name="Kotlin">

```kotlin title="android/app/build.gradle.kts"
...
dependencies {
...
implementation("com.google.android.play:core:1.8.0")
...
}
```

</Tab>
<Tab name="Groovy">

```groovy title="android/app/build.gradle"
...
dependencies {
...
implementation "com.google.android.play:core:1.8.0"
...
}
```

</Tab>
</Tabs>
</li>

<li>
Expand Down Expand Up @@ -558,11 +576,25 @@ defined in the pubspec named, `boxComponent`, `circleComponent`,
and `assetComponent`, ensure that `android/settings.gradle`
contains the following:

```groovy
<Tabs key="android-settings-gradle">
<Tab name="Kotlin">

```kotlin title="android/settings.gradle.kts"
include(":app", ":boxComponent", ":circleComponent", ":assetComponent")
...
```

</Tab>
<Tab name="Groovy">

```groovy title="android/settings.gradle"
include ':app', ':boxComponent', ':circleComponent', ':assetComponent'
...
```

</Tab>
</Tabs>

</li>

<li>
Expand Down
93 changes: 92 additions & 1 deletion src/content/platform-integration/android/compose-activity.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,26 @@ The first file requiring modifications is `android/app/build.gradle`.

1. Add the following to the existing `android` block:

<Tabs key="android-build-features">
<Tab name="Kotlin">

```kotlin title="android/app/build.gradle.kts"
android {
// Begin adding here
buildFeatures {
compose = true
}
composeOptions {
// https://developer.android.com/jetpack/androidx/releases/compose-kotlin
kotlinCompilerExtensionVersion = "1.4.8"
}
// End adding here
}
```

</Tab>
<Tab name="Groovy">

```groovy title="android/app/build.gradle"
android {
// Begin adding here
Expand All @@ -128,6 +148,9 @@ The first file requiring modifications is `android/app/build.gradle`.
}
```

</Tab>
</Tabs>

Visit the [developer.android.com][] link in the code snippet and
adjust `kotlinCompilerExtensionVersion`, as necessary.
You should only need to do this if you
Expand All @@ -138,6 +161,34 @@ The first file requiring modifications is `android/app/build.gradle`.

2. Next, add the following block at the bottom of the file, at the root level:

<Tabs key="android-dependencies">
<Tab name="Kotlin">

```kotlin title="android/app/build.gradle.kts"
dependencies {
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.activity:activity-compose")
implementation(platform("androidx.compose:compose-bom:2024.06.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material:material")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2024.06.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
}
```

</Tab>
<Tab name="Groovy">

```groovy title="android/app/build.gradle"
dependencies {
implementation("androidx.core:core-ktx:1.10.1")
Expand All @@ -155,14 +206,51 @@ The first file requiring modifications is `android/app/build.gradle`.
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation "androidx.core:core-ktx:1.10.1"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.1"
implementation "androidx.activity:activity-compose"
implementation platform("androidx.compose:compose-bom:2024.06.00")
implementation "androidx.compose.ui:ui"
implementation "androidx.compose.ui:ui-graphics"
implementation "androidx.compose.ui:ui-tooling-preview"
implementation "androidx.compose.material:material"
implementation "androidx.compose.material3:material3"
testImplementation "junit:junit:4.13.2"
androidTestImplementation "androidx.test.ext:junit:1.1.5"
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
androidTestImplementation platform("androidx.compose:compose-bom:2023.08.00")
androidTestImplementation "androidx.compose.ui:ui-test-junit4"
debugImplementation "androidx.compose.ui:ui-tooling"
debugImplementation "androidx.compose.ui:ui-test-manifest"
}
```

</Tab>
</Tabs>

The second file requiring modifications is `android/build.gradle`.

1. Add the following buildscript block at the top of the file:

<Tabs key="android-buildscript">
<Tab name="Kotlin">

```kotlin title="android/build.gradle.kts"
buildscript {
dependencies {
// Replace with the latest version.
classpath("com.android.tools.build:gradle:8.1.1")
}
repositories {
google()
mavenCentral()
}
}
```

</Tab>
<Tab name="Groovy">

```groovy title="android/build.gradle"
buildscript {
dependencies {
Expand All @@ -176,6 +264,9 @@ The first file requiring modifications is `android/app/build.gradle`.
}
```

</Tab>
</Tabs>

The third file requiring modifications is
`android/app/src/main/AndroidManifest.xml`.

Expand Down
Loading