Skip to content

Commit a219215

Browse files
khanderzvincenzopalazzo
authored andcommitted
fix(graphql_flutter): update connectivity_plus version to fix Android build issues
This update resolves build failures caused by outdated configurations in Android Gradle Plugin (AGP). The errors included: Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'. Could not resolve all files for configuration ':connectivity_plus:androidJdkImage'. The fix includes: - Updating connectivity_plus version. - Updating compileOptions and kotlinOptions to target Java 17. - Updating gradle-wrapper.properties to use Gradle 8.4. - Adding documentation for Java 17 build requirements. Fixes zino-hofmann#1480
1 parent 74a99bf commit a219215

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

packages/graphql_flutter/README.md

+42
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

packages/graphql_flutter/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
meta: ^1.15.0
1616
path_provider: ^2.0.1
1717
path: ^1.9.0
18-
connectivity_plus: ^6.0.3
18+
connectivity_plus: ^6.1.3
1919
hive: ^2.0.0
2020
plugin_platform_interface: ^2.0.0
2121
flutter_hooks: '>=0.18.2 <0.21.0'

0 commit comments

Comments
 (0)