-
-
Notifications
You must be signed in to change notification settings - Fork 118
[background-http] App crashes due to IllegalArgumentException #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Might be related to #274 |
@grigala : Have you found a solution for this? I am also stuck with the same problem |
Hi @pap5508, nothing that's 100% tested so far, but you can give it a try and do this before you call/construct bghttp session: if (android.os.Build.VERSION.SDK_INT >= 26) {
const channel = new android.app.NotificationChannel(
"NotificationChannel",
"My App",
android.app.NotificationManager.IMPORTANCE_HIGH // adjust to your requirement
);
const manager = Utils.android
.getApplicationContext()
.getSystemService(android.content.Context.NOTIFICATION_SERVICE) as android.app.NotificationManager;
manager.createNotificationChannel(channel);
} |
I can't get it working with this. Get the same error. |
The |
I face the same issue. However, the init() calling before uploading multipart still gives me the same error... Where are you calling the init? main.ts still? |
@Maxeeezy : Yes, I have added in main.ts and working fine. |
I run into this issue as well on Android. Not every upload (we use
(extra info but theory: I think it's related to coming back from a Camera activity and somehow that namespace is not ready. I called init() in appResume (should be idempotent if already initialized) but that doesn't seem to fix it completely) |
I am experiencing the same issue. Sometimes it throws the exception about a missing namespace when returning from the camera. |
Latest
@nativescript/background-http
crashes some Android devices withYou have to set namespace to your app package name (context.packageName) in your Application subclass
:Full trace from Google Play Console:
Calling
init()
from themain.ts
does not help this particular problem, because error occurs while having this in mymain.ts
:According to gotev/android-upload-service#510
createNotificationChannel()
needs to be called explicitly.The text was updated successfully, but these errors were encountered: