Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: Target of URI doesn't exist: 'package:test/test.dart'

Since the latest flutter update my tests are broken. It looks like the Dart test framework isn't available anymore:

error: Target of URI doesn't exist: 'package:test/test.dart'. 
like image 538
Soundbytes Avatar asked Nov 08 '18 13:11

Soundbytes


People also ask

How do you solve the target of URI doesn't exist package flutter material Dart?

Possible reasons for the error target of URI doesn't exist 1) check pubspec. yaml file 2) import package as http/xml 3) Forget to run command flutter pub get4) Conflict resolution 5) pushing code to git. There are multiple ways to solve the target of uri doesn't exist flutter code error.

How do you solve the target of URI doesn't exist?

Just open the terminal from the project directory and run. to Solve Target of URI doesn't exist 'package:flutter/material. dart' Error This problem has happened for several reasons. You have created a project and then you try to push the code to Git while your VS code is open.


1 Answers

If you've upgraded to a recent master, you'll find that flutter_test has removed its dependency on package:test. The package hasn't been removed or renamed, but you will need to specifically add it to you dev_dependencies in your pubspec now:

dev_dependencies:
  test: ^1.5.1

The test_api package is just used to unify the versioning and reduce the depencies of flutter_test. It didn't replace package:test. There are also no breaking changes in any of these newer test versions.

like image 188
Jonah Williams Avatar answered Oct 23 '22 23:10

Jonah Williams