How to login/logout in flutter pub publish? - flutter-packages

I am trying to publish upgrade for my package and getting error:
Insufficient permissions to upload new versions of package...
I am signed in in Chrome to pub.dev with account that is administrator in publisher for the package.
How can I check what is current account in 'flutter pub', and switch to right account?

This works for me:
pub logout
... and then you can try publishing again:
pub publish

Run flutter pub logout to logout and flutter pub login to login.

To sign out, you need to locate and delete credentials.json from your flutter/.pub-cache. It is hidden, so you need to press Command+Shift+Dot, if do it in Mac Finder.
After you signed out, run 'flutter pub publish' and it will guide you through sign in process.

Related

My Flutter app is stuck in installing Apk while running it

My Flutter app works perfectly fine. But when I add the following dependency of firebase admob for Ads, it get stuck at installing apk file when I run it.
firebase_admob: ^0.9.3+1
When I remove it, it again works fine. I have restarted the app, cleared cache, done flutter run but none of the above worked for me.
Check your Android Manifest xml file in android. It should include the admob id for your app after "activity":

Flutter app works as .apk, but "installation failed" with firebase distribution

I am trying to put a Flutter app on Firebase app distribution. I build the .apk, then transfer it onto my android phone. When I test it, no issues. Then, I upload the .apk to Firebase app distribution and try to install it on my phone (after deleting the first). The app downloads, and then attempts to install, but rather than finishing, it closes and gives the error: "Installation failed." I'm assuming this is an error with firebase distribution because the original .apk works, simply will not install when transferred onto distribution.
Things I've tried:
Enabling multidex
Adding signing config
flutter clean
flutter build apk
Any ideas? Thanks!
This happens when you already have the app installed but the signing keys don't match. Perhaps you are installing a debug version on top of a release version?

FireBase iOS SDK & User Data/Cache

Run App in the iOS Simulator
Go through the login flow and login
Stop App and Remove App from the iOS Simulator
Run App and notice that the cache persists; FirAuth.auth()?.currentUser is the user that I previously logged in with before removing the app.
My assumption that by removing the app from the simulator enables me to start from a blank slate next time I run is not correct.
Can somebody please explain how/why the cache persists?
Firebase manages this internally. The user which you get from FirAuth.auth()?.currentUser has nothing to deal with cache. So, even you delete the app from your simulator you will get currentUser.

Cannot login with the Firebase CLI

I have a problem when I try to login to Firebase using the CLI. I installed firebase-tools using npm -g install firebase-tools with admin rights. The steps I do are (from a cygwin terminal on Windows 10 Professional):
firebase login --no-localhost
After this I get the message:
Visit the URL on any device....
Paste authentication code here:
Then, on my browser, I see Google asking if I give Firebase CLI access rights, I say yes and then I get an authorization code displayed on the browser.
I copy this code into the cygwin console and then:
Error: Authentication Error.
I'm at a total loss for this and it's completely stalling my efforts to get to know Firebase. All help gratefully appreciated.
Try:
firebase login --interactive
it will open up a browser window to authenticate.
In my case was bug in terminal in Visual Studio Code. On CMD terminal it start works.
On windows 10, I had issues with my firebase login through cli. I had to run my command line as the administrator and it worked.
I got the same issue today and it was because back in the day I used firebase and didn't remove this define from my bash_profile
FIREBASE_TOKEN
try echo $FIREBASE_TOKEN if something shows up try deleting, open new terminal and re-authenticating
This works for me.
my FIREBASE_TOKEN was FIREBASE_TOKEN=' '. I logged out of all my terminal sessions and tried again and that worked.
Just run the cmd wit administrator privilege...! Happy coding
If you really can't log in with firebase CLI using the "firebase login" command
Then, use GitBash instead of PowerShell in the VS code or any other code editor terminal.
First, download Git SCM then use gitbash in the terminal for any kind of Firebase hosting command terminal image using gitBash
It does work actually!!
I used with cmd, it was worked.
I copy pasted the link into an incognito window, and somehow it worked.
After running across this problem I tried multiple different things to solve this:
Used firebase login --reauth
Used firebase login --no-localhost
Turned off proxy settings
Ran command from within windows/system32
Turned off my security settings in Firefox
All these options listed above worked for others but not for me
Finally the way it worked was to install google chrome and run the command from from chrome instead of firefox
Check your firebase version. if firebase version is "8.15.0" this, then its okay, if not: uninstall firebase-tools globally and globally install it again with 'version'
npm i --global firebase-tools#8.15.0
then after check which terminal u r using, make sure to use cmd terminal. go to your directory and fire command
firebase login.
Check if its working

/usr/bin/codesign failed with exit code 1 in Xcode 6.4 (yosemite 10.10.5) when trying to run on iPad

Everything started when I tried to create and validate my archive for the new app version.
My developer certificate expired, I revoked it (I didn't revoke distribution certificate it is still valid) and now it is up to date. I deleted my old associated provisioning profiled from Xcode and Xcode is configured to generate them automatically. After The provisioning profiles were not in my account. I was able to compile fine without errors using simulator, but I can not run app on my iPad. I deleted old app version (I could not find in iPad Settings->General any Profiles to delete since my version is iOS8.4 and it deletes it automatically) I don't know if I need to delete anything else on iPad?
Now when I try to run from Xcode app on iPad, I get this error:
Command /usr/bin/codesign failed with exit code 1
(see details below)
NOTE1: I don't get this error when I run it in the simulator, only when I chose to run on registered iPad
NOTE2: I was able to run app on this same iPad before I revoked the certificate.
NOTE3: I was able to create archive and submit the app before, problems started when certificates expired.
All troubles started after revoking the certificate.
I am running Xcode version 6.4
Mac has OS X Yosemite Version 10.10.5
Here is what I did so far:
After revoking certificates,I tried to delete provisioning profiles and restart Xcode, Mac and iPad and that didn't help.
I deleted old certificates from keychain, right now I have just the new up to date certificate in my keychain.
When I tried to run Xcode it asked me to fix non-existing provisioning profiles and it worked for simulator, but not for iPad.
I also looked in Xcode general settings for the build and tried various things, but that didn't help...
This didn't help too:
Xcode -> Preferences -> Accounts -> Choose your account, and then View Details -> Refresh (button on bottom left), Refresh again, restart Xcode
I tried to read developer guides for distribution, but troubleshooting suggestions how to run on development device didn't help, also I didn't find much about this codsign error.
I also downloaded new certificate WWDR from Apple, that didn't help.
I tried most of the things what people suggested related to this error posted, but didn't help...
One additional info:
My problem is also that I am trying to submit second version of the existing app, so I don't know what I can delete in order to be able to submit the updated version of my app again. If it was new project I would create new project from scratch and start from zero, but this happened just when I was ready to submit new archive...
Do you have any suggestion how to fix this issue, which steps to follow?
I would appreciate your pointers where to read or what to do.
If you need additional info from me, please let me know.
Thanking you in advance, -Tatjana
CodeSign /Users/t/Library/Developer/Xcode/DerivedData/K-eskcdowdkybtiygveputefcuziqr/Build/Products/Debug-iphoneos/K.app
cd /Users/t/Desktop/myProjects/K
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Signing Identity: "iPhone Developer: T... (G....)"
Provisioning Profile: "iOS Team Provisioning Profile: com.k.K"
(5....)
/usr/bin/codesign --force --sign D.... --entitlements /Users/t/Library/Developer/Xcode/DerivedData/K-e.../Build/Intermediates/K.build/Debug-iphoneos/K.build/K.app.xcent /Users/t/Library/Developer/Xcode/DerivedData/K-e..../Build/Products/Debug-iphoneos/K.app
CSSM_SignData returned: 8001094A
/Users/t/Library/Developer/Xcode/DerivedData/K-e..../Build/Products/Debug-iphoneos/K.app: errSecInternalComponent
Command /usr/bin/codesign failed with exit code 1

Resources