Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:46:44+00:00 2026-06-15T18:46:44+00:00

I have a pubspec.yaml file like this: name: My App dependencies: unittest: { sdk:

  • 0

I have a pubspec.yaml file like this:

name: My App
dependencies:
  unittest: { sdk: unittest }
  json_object:
    git:
      url: git://github.com/chrisbu/dartwatch-JsonObject.git

(I’m just using JsonObject as an example here)

When I run pub install I get this error:

Package 'unittest' is depended on from both sources 'sdk' and 'hosted'

What does this mean and how can I resolve it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:46:45+00:00Added an answer on June 15, 2026 at 6:46 pm

    Pub, the Dart package manager, identifies packages by name as well as where they come from. If pub detects two packages with the same name, but come from two different sources, it will throw an error like “Package foo is dependend on from both sources ‘sdk’ and ‘hosted'”

    To resolve this, you need to ensure all of your dependencies refer to the same package with the same source.

    The right solution is for every package to stop using the sdk sources, as all of the SDK packages are now hosted in pub.dartlang.org.

    You should change:

    dependencies:
      unittest: { sdk: test }
    

    Into this:

    dependencies:
      unittest: any
    

    The any means “any version from pub.dartlang.org”

    The following packages are now in pub, their new canonical home:

    • args
    • http
    • intl
    • logging
    • meta
    • oauth2
    • unittest
    • webdriver

    If you use any of the above packages, please use foo: any instead of {sdk: foo} in your pubspec.yaml file.

    Now, of course you as a developer can update your own pubspec.yaml, but you may not be able to control your 3rd party dependencies. I recommend that you contact your package’s author via email (which you can get from pub.dartlang.org) as ask them to update to using hosted packages like unittest.

    See more at http://news.dartlang.org/2012/12/sdk-packages-now-available-on-pub.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a xml data like <Items><Item><name>test1</name></Item><Item><name>test2</name></Item></Items> Looks like jaxb cannot unmashall this when defining
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
have a php code like this,going to convert it in to C#. function isValid($n){
Have a look at this url: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:jquery_ui_methods#column_chooser I have got the Column Chooser dialog
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have been trying couple of hours now to make my iphone app universal. The
have Googled the cr*p out of this one so apologies if the answer is
Have a really weird one here. The app has two targets, just to be
have some headers like: HTTP/1.1 100 Continue HTTP/1.1 302 Found HTTP/1.1 200 OK HTTP/1.1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.