EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

Error during `tns prepare android` between 8.0.1 and 8.1.1 #1195

Open asgerjensen opened 5 years ago

asgerjensen commented 5 years ago

After upgrading from 8.0.1 to 8.1.1 my CI server (Azure DevOps) gives this exception during the prepare phase of an android build:

In response to tns prepare android, with version 8.1.1 of this plugin, I get

nativescript-plugin-firebase: /Users/vsts/agent/2.148.2/work/1/s/platforms/android/.pluginfirebaseinfo not found, forcing prepare!
nativescript-plugin-firebase: running release build or change in environment detected, forcing prepare!
Found peer node-sass
Found peer TypeScript 3.1.6
Preparing project...
Successfully prepared plugin nativescript-angular for android.
Successfully prepared plugin nativescript-geocoding for android.
Successfully prepared plugin nativescript-geolocation for android.
Successfully prepared plugin nativescript-https for android.
Successfully prepared plugin nativescript-iqkeyboardmanager for android.
Successfully prepared plugin nativescript-local-notifications for android.
Successfully prepared plugin nativescript-localize for android.
Successfully prepared plugin nativescript-localstorage for android.
Successfully prepared plugin nativescript-plugin-firebase for android.
Successfully prepared plugin nativescript-pulltorefresh for android.
nativescript-realm is not supported for android.
Successfully prepared plugin nativescript-realm for android.
Successfully prepared plugin nativescript-sqlite for android.
Successfully prepared plugin nativescript-swiss-army-knife for android.
Successfully prepared plugin nativescript-theme-core for android.
Successfully prepared plugin nativescript-ui-listview for android.
Successfully prepared plugin nativescript-unit-test-runner for android.
Successfully prepared plugin nativescript-windowed-modal for android.
Successfully prepared plugin tns-core-modules for android.
Successfully prepared plugin nativescript-intl for android.
Successfully prepared plugin nativescript-permissions for android.
Successfully prepared plugin nativescript-ui-core for android.
Successfully prepared plugin tns-core-modules-widgets for android.
The server returned unexpected response: {"$id":"1","innerException":null,"message":"TF400813: Resource not available for anonymous access. Client authentication required.","typeName":"Microsoft.TeamFoundation.Framework.Server.UnauthorizedRequestException, Microsoft.TeamFoundation.Framework.Server","typeKey":"UnauthorizedRequestException","errorCode":0,"eventId":3000}
# tns prepare

Now, I realize that the error message itself comes from Azure DevOps, but after looking at the various checkins that has been between 8.0.1 (which works), and 8.1.1 (which doesnt), I cant narrow down what part of the process is failing.

Any pointers as to what its trying to do differently, in the post-prepare between 8.0.1 and 8.1.1 that could cause it to try to resolve (maven/gradle/npm) something different, would be greatly appreciated, so I can try to track down the root cause.

EddyVerbruggen commented 5 years ago

This would be the only thing that may interfere with your build: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/commit/e556c25751f5303a42a72fc547671e2a08b0b32f

asgerjensen commented 5 years ago

Thanks,

I cant really see any reason why that would cause this change though.

It, ofcourse, works perfectly on my local setup, and the main difference I can see between my own setup, and the CI, is that the CI has a global Gradle version 5.2.1 ; but I doubt its being used by the build.

I do have a before-plugins.gradle file with

android {  

  project.ext {
      googlePlayServicesVersion = "+"
  }
} 

in it, but it seems to match the condition in the check just fine.

timdoege commented 5 years ago

If anyone should encounter this: Adding an npm authenticate step (for task runners) before running tns build resolves this issue:

          - task: npmAuthenticate@0
            inputs:
                workingFile: $(Build.SourcesDirectory)/.npmrc