Git Product home page Git Product logo

Comments (15)

pattobrien avatar pattobrien commented on May 18, 2024

+1 - not able to use this package at all because of this error.

from unpub.

DanOxlade avatar DanOxlade commented on May 18, 2024

+1 - Also seeing this error

from unpub.

talisk avatar talisk commented on May 18, 2024

Which command did you run? And paste flutter doctor log here please. @mmarazik @DanOxlade @pattobrien

from unpub.

mmarazik avatar mmarazik commented on May 18, 2024

I was running this command

$ flutter pub publish --server http://192.168.8.174:4000

(that's the IP of my local intranet server, that I published on before)
After I get the message

Do you want to publish mt_formalyze 0.0.2 (y/N)? y
Uploading ...
missing authorization header
pub finished with exit code 1

And output of flutter doctor -v is

[✓] Flutter (Channel stable, 2.8.1, on macOS 11.3.1 20E241 darwin-x64, locale en-EG)
• Flutter version 2.8.1 at /Users/may/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/may/Library/Android/sdk
• Platform android-32, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 12.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.0.0.
Download the latest version or update via the Mac App Store.
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.64.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.34.0

[✓] Connected device (3 available)
• Nexus 4 (mobile) • 017a92910a8da94b • android-arm • Android 5.1.1 (API 22)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80

! Doctor found issues in 1 category.

from unpub.

talisk avatar talisk commented on May 18, 2024

@mmarazik You should use unpub_auth cli tool to adapt the new authorization since Dart 2.15. Read https://github.com/bytedance/unpub/tree/master/unpub_auth

from unpub.

mmarazik avatar mmarazik commented on May 18, 2024

Thank you for the reponse,

I tried doing that before, but it said that unpub_auth is only for https servers, my server is http, must we enable https or is there a way to work with it as http?

from unpub.

talisk avatar talisk commented on May 18, 2024

Thank you for the reponse,

I tried doing that before, but it said that unpub_auth is only for https servers, my server is http, must we enable https or is there a way to work with it as http?

Please show me the output if it said that unpub_auth is only for https servers. It doesn't look like unpub_auth output.

from unpub.

mmarazik avatar mmarazik commented on May 18, 2024

According to unpub_auth documentation
"Before calling dart pub publish or flutter pub publish, please call unpub_auth get | dart pub token add first."

so first I called
$unpub_auth login

and I logged in successfully

then when calling

$dart pub token add http://192.168.8.174:4000
Invalid [hosted-url]: "http://192.168.8.174:4000"
url must be https://, insecure repositories cannot use authentication.

Usage: pub token add
-h, --help Print this usage information.
--env-var Read the secret token from this environment variable when making requests.

Run "dart help" to see global options.

from unpub.

talisk avatar talisk commented on May 18, 2024

Invalid [hosted-url]: "http://192.168.8.174:4000"
url must be https://, insecure repositories cannot use authentication.

It's the limit of the official Dart pub command.
You should see dart-lang/pub#3286.

from unpub.

DanOxlade avatar DanOxlade commented on May 18, 2024

After updating Flutter to 2.10.0 and I'm able to publish now. My local unpub server is using https though.

from unpub.

talisk avatar talisk commented on May 18, 2024

Does anyone else have any questions? @pattobrien @mmarazik

from unpub.

mmarazik avatar mmarazik commented on May 18, 2024

Just to be clear so we cannot use this package with http since dart 2.15? it has to be https, is this right?

from unpub.

talisk avatar talisk commented on May 18, 2024

Just to be clear so we cannot use this package with http since dart 2.15? it has to be https, is this right?

unpub_auth is a independent auth tool for unpub. It is only adapt Dart 2.15 and later. unpub is a pub server. It's nothing to do with Dart version.

"url must be https://, insecure repositories cannot use authentication." is a prompt message from the Dart client. It seems that you should use https in your unpub server since Dart 2.15.

from unpub.

mmarazik avatar mmarazik commented on May 18, 2024

For those who managed to run unpub on https, can you please share how did you do that?

from unpub.

sahani-deriv avatar sahani-deriv commented on May 18, 2024

For those who managed to run unpub on https, can you please share how did you do that?

@mmarazik just use ngrok

from unpub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.