0

I use flutter create testtest to create a sample app called testest to run the sample test case, but it throw errors, when I run flutter test ./test/widget_test.dart

errors:

flutter test
00:00 +0 -1: loading /home/helen/Git/testtest/test/widget_test.dart [E]                            
Failed to load "Git/testtest/test/widget_test.dart":
Shell subprocess crashed with unexpected exit code 127 before connecting to test harness.
Test: Git/testtest/test/widget_test.dart
Shell: /home/h/flutter/bin/cache/artifacts/engine/linux-x64/flutter_tester


00:00 +0 -1: Some tests failed.                                                                    
Shell: /home/h/flutter/bin/cache/artifacts/engine/linux-  x64/flutter_tester: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory

Test code import 'package:flutter/material.dart';

 import 'package:flutter_test/flutter_test.dart';
 import 'package:testtest/main.dart';

 void main() {
    testWidgets('Counter increments smoke test', (WidgetTester tester) async {
     // Build our app and trigger a frame.
     await tester.pumpWidget(new MyApp());

    // Verify that our counter starts at 0.
    expect(find.text('0'), findsOneWidget);
    expect(find.text('1'), findsNothing);

    // Tap the '+' icon and trigger a frame.
    await tester.tap(find.byIcon(Icons.add));
    await tester.pump();

    // Verify that our counter has incremented.
    expect(find.text('0'), findsNothing);
    expect(find.text('1'), findsOneWidget);
 });
 }

flutter doctor

[✓] Flutter (on Linux, locale en_NZ.UTF-8, channel alpha) • Flutter at /home/helen/flutter • Framework revision 8f65fec5f5 (4 weeks ago), 2017-12-12 09:50:14 -0800 • Engine revision edaecdc8b8 • Tools Dart version 1.25.0-dev.11.0 • Engine Dart version 2.0.0-edge.d8ae797298c3a6cf8dc9f4558707bd2672224d3e

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.3) • Android SDK at /home/helen/Android/Sdk • Android NDK at /home/helen/Android/Sdk/ndk-bundle • Platform android-26, build-tools 26.0.3 • Java binary at: /home/helen/sdks/android-studio/jre/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] Android Studio (version 3.0) • Android Studio at /home/helen/sdks/android-studio • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)

[✓] IntelliJ IDEA Community Edition (version 2017.2) • Flutter plugin version 18.4 • Dart plugin version 172.4343.25

[-] Connected devices • None

Solution: I'm using fedora and to to solve this problem, run the command: sudo dnf install mesa-libGLU.x86_64

2
  • Does flutter doctor report any errors? Commented Jan 9, 2018 at 8:55
  • @GünterZöchbauer : flutter doctor seems fine to me Commented Jan 9, 2018 at 20:27

1 Answer 1

1

looks something related to libGLU...

Shell: /home/h/flutter/bin/cache/artifacts/engine/linux-  x64/flutter_tester: error while loading shared libraries: libGLU.so.1: cannot open shared object file: No such file or directory

check if you have the correct packet installed. If not:

## UBUNTU-LIKE ##
sudo apt-get install libglu1
## Fedora ##
dnf install mesa-libGLU.x86_64

or

## UBUNTU-LIKE ##
sudo apt-get install libglu1-mesa:i386
## Fedora ##
dnf install mesa-libGLU.i686

depending if you might need the 32bits version

Sign up to request clarification or add additional context in comments.

4 Comments

it throws error when trying to install either libglu1 or libglu1-mesa:i386. Error: sudo dnf install libglu1 Last metadata expiration check: 0:10:41 ago on Wed 10 Jan 2018 09:06:06 NZDT. No match for argument: libglu1
by the way, I'm using fedora
I edited to add the solution. It was so close, I guessed your system had installed the 64-bit already...
I'm not sure if this command dnf install mesa-libGLU.i686 would solve the issue, but 1 upvote for your effort :) thanks again

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.