patrol
patrol copied to clipboard
First android build failed
Steps to reproduce
- git checkout 827b11c764d63123259560e8546aab71b61c1470 - current master
- dart run /patrol/packages/patrol_cli/bin/main.dart test --verbose --target integration_test/example_test.dart
Actual results
Android test builds always failed with this error. Some solutions from the Internet didn't help, but the problem disappeared when I built the example app normally using "flutter run". This issue is similar to the other where we need to build our app at least once.
Logs
Logs
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not open proj generic class cache for build file 'patrol/packages/patrol/example/android/build.gradle' (/.gradle/caches/7.6.2/scripts/7jd035x0svt1nqxqk95ifino8).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 64
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 619ms
✗ Failed to build apk with entrypoint test_bundle.dart (Gradle build failed with code 1) (1.1s)
Patrol version
patrol: master == 827b11c764d63123259560e8546aab71b61c1470
Patrol Doctor output
Patrol Doctor output
You're using Patrol CLI 2.0, which has breaking changes.
Read the migration guide at https://patrol.leancode.co/v2.
Disable this warning by setting the PATROL_MIGRATED environment variable.
Patrol CLI version: 2.1.1
Program adb found in /Users/User/Library/Android/sdk/platform-tools/adb
Env var $ANDROID_HOME set to /Users/User/Library/Android/sdk
Program xcodebuild found in /usr/bin/xcodebuild
Program ideviceinstaller not found (install with `brew install ideviceinstaller`)
Flutter Doctor output
Flutter Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-x64, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.81.1)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
Can I take the Issue?
Can you please brief that If you are trying to make bundle or apk what are the error's it is showing
That's because Gradle wrapper doesn't exist until flutter build
is executed.
We could fix this bug very easily by running flutter build apk --config-only
before proceeding with gradlew
invocations – but it's only available in Flutter 3.13 and newer.
See also #1837 where a implementation idea was proposed
I'll try to have a crack at this over the weekend.
@richchurcher actually you can wait with it for our 3.0 release. We'll bump our min Flutter SDK version to the next stable Flutter then (the one that'll likely come out in November).
Then this task will become simpler, you won't even have to check for Flutter version. You will be able to call --config-only
unconditionally.
Oh good point, it'll be much easier to assume the version.
We released 3.0 last week and our minimum Flutter version is 3.16 now. So this change should be quite easy.
Nice! Unfortunately they broke debugging in 3.16 so I've had to move to 3.17 beta, but that shouldn't stop me from fixing this.
Hello, I'm wondering if this has been fixed? I'm running into the same issue with CLI 2.2.2 and Patrol 2.3.2. I can't really upgrade to Flutter >3.13, so I wanted to ask if there's any workarounds in the meantime?
Size: S
This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.