NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
102 stars 50 forks source link

Build hangs during android release build and unable to run release built using Sidekick. #234

Closed pajohns closed 5 years ago

pajohns commented 5 years ago

When running the following command, the build hangs when running the gradle build.

tns build android --release --key-store-path ../../certificates/android/logdin.keystore --key-store-password ******** --key-store-alias logdin-cert --key-store-alias-password ********** —copy-to ../test.apk

[5] 22540
-bash: DG: command not found

Skipping prepare.
Building project...
Gradle build...

> Starting Daemon > Connecting to Daemon

It stops at this point. Is there something wrong with my command or is this an issue? If I use NativeScript Sidekick to build the release, it succeeds fine, however when the apk is installed it doesn't function in the same way it does when debugging. It seems that whenever it is using HttpClient there is something incorrecct, but as I can't debug an apk there's no knowing why.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

elena-p commented 5 years ago

Hi @pajohns,

There is a known issue with {N} 5.4 and nativescript-angular@8.0.2 - https://github.com/NativeScript/nativescript-angular/issues/1914 Could you set "nativescript-angular": "8.0.1" and "@angular/http": "8.0.0-beta.10" to fixed versions and try again?

pajohns commented 5 years ago

Hi Elena, I was not using @8.0.2, I was using @8.0.0 (see above), but I have done as you said and upgraded the package to @8.0.1 and try this. With regards to @angular/http there is no fixed version as @angular/http has been deprecated per the final notes section on the introduction to Angular 8 page on the NativeScript site. The only v8 version is the one I've used, which is a beta release and 8.0.0-beta.10 and is a dependency required by nativescript-angular@8.0.1.

Having said that there are other dependencies that I haven't installed per the npm warnings:

npm WARN nativescript-angular@8.0.1 requires a peer of zone.js@^0.8.4 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@8.0.0-beta.10 requires a peer of @angular/core@8.0.0-beta.10+1.sha-a28b3e3 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/http@8.0.0-beta.10 requires a peer of @angular/platform-browser@8.0.0-beta.10+1.sha-a28b3e3 but none is installed. You must install peer dependencies yourself.

I'm wondering if this could be related? At what point can we remove @angular/http altogether given that it is not required?

pajohns commented 5 years ago

Update: I have tried upgrading to TNS 6.0.2 using nativescript-angular@8.0.2 yet I'm still having this problem as in neither building using command line and the application hangs when attempting to use @angular/http. I am really stumped with this one. Is there a way of debugging or even getting the application logs from an apk so I can see what is going on? I just have no place to start as it's happening in the APK only and no issues with debugging.

pajohns commented 5 years ago

Update: So to be clear this is really two issues: 1. Unable to build a release from command line and 2. Unable to run the release that was built using sidekick.

With respect to issue 2, I have been able to reproduce the issue using debug. The issue was that I was building in Sidekick using the AOT option. When I ran through command line using tns debug android --env.aot it would also hang when attempting to log in. This is the stacktrace from the debug monitor:

JS: Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'ng-untouched: true'. Current value: 'ng-untouched: false'.
JS: Error: Uncaught (in promise): TypeError: ctor is not a constructor
JS: TypeError: ctor is not a constructor
JS:     at _createClass file:///node_modules/@angular/core/fesm5/core.js:18503:0
JS:     at _createProviderInstance file:///node_modules/@angular/core/fesm5/core.js:18477:0
JS:     at resolveNgModuleDep file:///node_modules/@angular/core/fesm5/core.js:18441:0
JS:     at NgModuleRef_.push.../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get file:///node_modules/@angular/core/fesm5/core.js:19149:0
JS:     at resolveDep file:///node_modules/@angular/core/fesm5/core.js:19520:0
JS:     at createClass file:///node_modules/@angular/core/fesm5/core.js:19400:0
JS:     at createDirectiveInstance file:///node_modules/@angular/core/fesm5/core.js:19271:0
JS:     at createViewNodes file:///node_modules/@angular/core/fesm5/core.js:27489:0
JS:     at createRootView file:///node_modules/@angular/core/fesm5/core.js:27403:0
JS:     at callWithDebugContext (file...

So I'm now able to at least build without using AOT, so that at least keeps me going. I think it has something to do with maybe implementing a change detection strategy, but unsure how best to do this with Nativescript. Anyone else facing this issue?

I am still experiencing the inability to build from the nativescript CLI to build a release version.

support[bot] commented 5 years ago

:wave: @pajohns, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please, use Stackoverflow to get help.