Skip to content

Commit 9994460

Browse files
committed
docs: add Java 17 build requirements
1 parent c07f91b commit 9994460

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

packages/graphql_flutter/README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,48 @@ And then import it inside your dart code:
7878
import 'package:graphql_flutter/graphql_flutter.dart';
7979
```
8080

81+
## Android Build Requirements
82+
83+
To ensure compatibility with the latest Android configurations, this project now requires **Java 17**. Please verify your development environment is set up accordingly:
84+
85+
### 1️⃣ Check Your Java Version
86+
87+
Run the following command to check your Java version:
88+
89+
```sh
90+
java -version
91+
```
92+
93+
Ensure the output indicates **Java 17**. If not, update your Java Development Kit (JDK) to version **17**.
94+
95+
### 2️⃣ Update Gradle Settings
96+
97+
Modify your `android/gradle/wrapper/gradle-wrapper.properties` file to use **Gradle 8.4**:
98+
99+
```properties
100+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
101+
```
102+
103+
### 3️⃣ Configure Build Settings
104+
105+
In your `android/app/build.gradle` file, update the `compileOptions` and `kotlinOptions` to **target Java 17**:
106+
107+
```gradle
108+
android {
109+
compileOptions {
110+
sourceCompatibility JavaVersion.VERSION_17
111+
targetCompatibility JavaVersion.VERSION_17
112+
}
113+
114+
kotlinOptions {
115+
jvmTarget = "17"
116+
}
117+
}
118+
```
119+
120+
By ensuring your environment matches these requirements, you can prevent potential build issues related to Java version incompatibilities.
121+
122+
81123
## Migration Guide
82124
Find the migration from version 3 to version 4 [here](./../../changelog-v3-v4.md).
83125

0 commit comments

Comments
 (0)