title: Flutter integration test not working, uri not found
body: <p>Edit: tl;dr If you're getting &quot;Target of URI doesn't exist&quot; errors when adding a new package, try closing the Android Studio project and re-opening it.</p>
  <p>I'm just getting started with integration testing on my Flutter app and for some reason it can't find the integration_testing uri.</p>
  <p><a href="https://i.stack.imgur.com/QfrJy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QfrJy.png" alt="error" /></a></p>
  <p>I've followed all the steps <a href="https://docs.flutter.dev/cookbook/testing/integration/introduction" rel="nofollow noreferrer">here</a> including:</p>
  <ol>
  <li>Updating my pubspec.yaml</li>
  </ol>
  <pre><code>dev_dependencies:
    integration_test:
      sdk: flutter
    flutter_test:
      sdk: flutter
  </code></pre>
  <ol start="2">
  <li><p>Creating the <code>integration_test/app_test.dart</code> directory and file:
  <a href="https://i.stack.imgur.com/asczp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/asczp.png" alt="enter image description here" /></a></p>
  </li>
  <li><p>Run <code>pub get</code>, <code>flutter clean</code>.</p>
  </li>
  <li><p>On latest flutter version and no issues with doctor:</p>
  </li>
  </ol>
  <pre><code>Doctor summary (to see all details, run flutter doctor -v):
  [✓] Flutter (Channel stable, 2.10.3, on macOS 11.3.1 20E241 darwin-arm, locale
      en-CA)
  [✓] Android toolchain - develop for Android devices (Android SDK version
      32.0.0-rc1)
  [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
  [✓] Chrome - develop for the web
  [✓] Android Studio (version 2021.1)
  [✓] IntelliJ IDEA Community Edition (version 2021.3)
  [✓] Connected device (2 available)
  [✓] HTTP Host Availability
  
  • No issues found!
  
  </code></pre>
  <p>Here's the complete <code>pubspec.yaml</code></p>
  <pre><code>name: squabbit
  description: A new Flutter application.
  
  # The following defines the version and build number for your application.
  # A version number is three numbers separated by dots, like 1.2.43
  # followed by an optional build number separated by a +.
  # Both the version and the builder number may be overridden in flutter
  # build by specifying --build-name and --build-number, respectively.
  # In Android, build-name is used as versionName while build-number used as versionCode.
  # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
  # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
  # Read more about iOS versioning at
  # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
  version: 1.8.0+80
  
  environment:
    sdk: &quot;&gt;=2.7.0 &lt;3.0.0&quot;
  
  dependencies:
    flutter:
      sdk: flutter
    firebase_core: ^1.1.0
    firebase_auth: ^1.1.3
    firebase_storage: ^8.0.5
    cloud_firestore: ^1.0.7
    firebase_crashlytics: ^2.0.2
    rxdart: 0.26.0
    intl: ^0.17.0
    #  file_picker: ^1.1.1
    google_sign_in: ^5.2.3
    image_picker: 0.7.4
    cached_network_image: ^3.0.0
    flutter_google_places: ^0.3.0
    google_maps_webservice: ^0.0.19
    carousel_pro: ^1.0.0
    flutter_launcher_icons: ^0.9.0
    package_info: ^2.0.0
    mime: ^0.9.7
    google_fonts: 2.1.0
    enum_to_string: 1.0.14
    shared_preferences: ^2.0.5
    algolia: 1.0.1
    flutter_email_sender: ^5.0.0
    device_info_plus: ^1.0.1
    material_design_icons_flutter: 4.0.5955
    visibility_detector: ^0.2.2
    fluttertoast: ^8.0.7
    in_app_review: ^2.0.2
    cloud_functions: ^3.0.0
    firebase_analytics: ^8.2.0
  
    # The following adds the Cupertino Icons font to your application.
    # Use with the CupertinoIcons class for iOS style icons.
    cupertino_icons: ^0.1.2
    in_app_purchase: ^0.5.2
    firebase_messaging: ^11.2.6
    firebase_remote_config: ^2.0.2
  
  dev_dependencies:
    integration_test:
      sdk: flutter
    flutter_test:
      sdk: flutter
  
  flutter_icons:
    android: false
    ios: true
    image_path: &quot;assets/icon/icon.png&quot;
  
  
  # For information on the generic Dart part of this file, see the
  # following page: https://www.dartlang.org/tools/pub/pubspec
  
  # The following section is specific to Flutter.
  flutter:
    assets:
      - assets/images/
  
    # The following line ensures that the Material Icons font is
    # included with your application, so that you can use the icons in
    # the material Icons class.
    uses-material-design: true
  
  </code></pre>