Getting below build errors when i use below patrol cli command to run test
patrol test --target integration_test/example_test.dart
**Build error 1 - Execution failed for task ':video_player_android:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.
Build error 2 - * What went wrong: java.lang.StackOverflowError (no error message)**
Below is the code
void main() {
patrolTest('demo', nativeAutomation: true, (PatrolTester $) async {
await $.pumpWidgetAndSettle(AwesomeApp());
// prepare network conditions
await $.native.enableCellular();
await $.native.disableWifi();
// toggle system theme
await $.native.enableDarkMode();
// handle native location permission request dialog
await $.native.selectFineLocation();
await $.native.grantPermissionWhenInUse();
// tap on the first notification
await $.native.openNotifications();
await $.native.tapOnNotificationByIndex(0);
});
}
Build should be successful and should be able to run the test successfully.
This is happening for incompatible
gradle
andjava
versions.To check the versions try
cd android && ./gradlew -v
Now, install the correct jvm and set it up in
.zshrc
or.bashrc
filejdk
for your gradle version; say it isopenjdk@17
openjdk@17
).rc
filevscode
orandroid studio
orvim
for the updated config to take effect