question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not working on Android 8.1.0 Pixel 2 XL with plugin version 3.2.3

See original GitHub issue

Which platform(s) does your issue occur on?

  • Android
  • 8.1.0
  • Pixel 2 XL

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

  • CLI: 3.4.2
  • Cross-platform modules: 3.4.1
  • Runtime(s): 3.4.2
  • Plugin(s):
"devDependencies": {
    "@angular/compiler-cli": "~5.2.0",
    "@ngtools/webpack": "~1.9.4",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "codelyzer": "~4.0.2",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "1.5.0",
    "nativescript-dev-typescript": "~0.6.0",
    "nativescript-dev-webpack": "~0.9.1",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "sass-loader": "~6.0.6",
    "tslint": "~5.8.0",
    "typescript": "~2.6.2",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0"
  }

Please, tell us how to recreate the issue in as much detail as possible.

When attempting upload I get the following error.

{"eventName":"error","object":{"_observers":{"progress":[{}],"error":[{}],"complete":[{}]},"_session":{"_id":"image-upload"},"_id":"image-upload{1}","_description":"{ 'uploading': IMG-20180421-WA0003.jpg }","_upload":0,"_totalUpload":1,"_status":"error"}}

This must be related to issue https://github.com/NativeScript/nativescript-background-http/issues/124, but the 3.2.3 release does not fix it for me.

I can get it working by applying the fix as described here, https://github.com/NativeScript/nativescript-background-http/issues/124#issuecomment-377788306.

I’ve tried removing the node_modules and reinstalling. I’ve tried removing tns platform remove android and reinstalling. Does not help.

Copy pasting the code from that comment into background-http.android.js works.

If I replace:

var displayNotificationProgress = typeof options.androidDisplayNotificationProgress === "boolean" ? options.androidDisplayNotificationProgress : true;
        if (displayNotificationProgress) {
            request.setNotificationConfig(new net.gotev.uploadservice.UploadNotificationConfig());
        }

with

const displayNotificationProgress = typeof options.androidDisplayNotificationProgress === "boolean" ? options.androidDisplayNotificationProgress : true;
        if (displayNotificationProgress) {
            const channel = new android.app.NotificationChannel(application.android.packageName, application.android.packageName,
                android.app.NotificationManager.IMPORTANCE_LOW);
            const notificationManager = context.getSystemService(android.content.Context.NOTIFICATION_SERVICE)
            notificationManager.createNotificationChannel(channel);

            const uploadNotificationConfig = new net.gotev.uploadservice.UploadNotificationConfig();
            uploadNotificationConfig.setNotificationChannelId(application.android.packageName)
            request.setNotificationConfig(uploadNotificationConfig);
        }

on lines 128 and 181 than it works.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crowebirdcommented, May 9, 2018

I am having this issue as well… nativescript-angular with background-http at 3.2.5 on sdk 26+ Going to give this fix a try.

Thanks @pauly815 / @FranciZ

Edit, for the record, this fixes things for me!

1reaction
pauly815commented, May 4, 2018

I’m observing the same issue as FranciZ on 3.2.5. I’m running TNS 3.4.2 on a Samsung S8 emulator with Android 8.0. Only thing that worked for me was the fix from issue #124.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an installed app that isn't working on a Pixel phone
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
TWRP 3.2.3-1 for Pixel 2 XL | Page 160 | XDA Forums
I have a Taimen on VZ and have not had any problems booting and installing latest TWRP. You may have a bad dl...
Read more >
Android 8.1.0 Oreo MR1 Released - Google Groups
android -8.1.0_r1 cannot pass my build. It seems the native.git has openmax header relocated to frameworks/native/headers/media_plugin/media/openmax. But other ...
Read more >
Pixel 2 and Pixel 2 XL: 13 Common Problems, and How to Fix ...
You could try uninstalling apps one by one and testing again or you could factory reset and reinstall selectively. If you do decide...
Read more >
(RHSA-2018:0496) Important: kernel security and bug fix update
(BZ#1538587) The Return Trampoline (Retpoline) mechanism mitigates the branch target injection, also known as the Spectre variant 2 vulnerability.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found