skip to Main Content

A basic Flutter app failed to launch on Firebase Test Lab for Android. I can see in the video that the app never came up so it never even tried running my tests, it just timed out. In the logs, I do not see any errors from my application; there are errors and warnings but I can’t understand any of them nor do I know if they’re ok to ignore. I used Firebase Test Lab on other projects and I’m accustomed to seeing lots of errors which I assume come from Firebase Test Lab’s infrastructure. I typically look through the errors to try to find something that might pertain to my app. In this case I don’t see anything that seems to be related to my app.

The app is from the code lab https://codelabs.developers.google.com/codelabs/flutter-codelab-first#0 .

The instructions for Firebase setup are at https://github.com/flutter/flutter/tree/main/packages/integration_test#firebase-test-lab .

The test passes when run locally by running the following command on my Mac:

./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../integration_test/app_test.dart

The command I run from my CI (gitlab) is as follows:

gcloud firebase test android run --type instrumentation --app build/app/outputs/apk/debug/app-debug.apk --test build/app/outputs/apk/androidTest/debug/app-debug-androidTest.apk

I got the same timeout by initiating the test through the Firebase Test Lab UI.

I also posted this question at https://firebase-community.slack.com/archives/C1MTSQ5QT/p1674438388007639 .

Any ideas for what I could investigate?

2

Answers


  1. Chosen as BEST ANSWER

    I was able to get Firebase Test Lab to test a Flutter App by using this Espresso "bridge" https://pub.dev/packages/espresso. So instead of writing Flutter tests with the integrationDriver from package:integration_test/integration_test_driver.dart as described in https://github.com/flutter/flutter/tree/main/packages/integration_test#driver-entrypoint, I can use the enableFlutterDriverExtension() from package:flutter_driver/driver_extension.dart .

    Not ideal.


  2. I had the same problem. I eventually tracked it down to my various AndroidManfiest.xml files, where I hadn’t updated the package attribute.

    ie. I had in my android/app/src/debug/AndroidManifest.xml this:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.example.myapp">
     ...
    

    instead of

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
         package="com.myreal.package">
    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search