NativeScript / NativeScript/plugins
[background-http] App crashes due to IllegalArgumentException
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 206
- Forks
- 123
- Merge medio
- 2 d 1 h
- PR fusionados (30 d)
- 1
Descripción
Latest @nativescript/background-http crashes some Android devices with You have to set namespace to your app package name (context.packageName) in your Application subclass:
Caused by: java.lang.IllegalArgumentException:
at net.gotev.uploadservice.UploadServiceConfig.getNamespace (UploadServiceConfig.kt:74)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationAction (UploadServiceConfig.kt:234)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationActionIntentFilter (UploadServiceConfig.kt:248)
at net.gotev.uploadservice.observer.request.NotificationActionsObserver.register (NotificationActionsObserver.kt:31)
at net.gotev.uploadservice.UploadService.onCreate (UploadService.kt:194)
at android.app.ActivityThread.handleCreateService (ActivityThread.java:4641)
Full trace from Google Play Console:
java.lang.RuntimeException:
at android.app.ActivityThread.handleCreateService (ActivityThread.java:4655)
at android.app.ActivityThread.access$2800 (ActivityThread.java:251)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2319)
at android.os.Handler.dispatchMessage (Handler.java:110)
at android.os.Looper.loop (Looper.java:219)
at android.app.ActivityThread.main (ActivityThread.java:8393)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1055)
Caused by: java.lang.IllegalArgumentException:
at net.gotev.uploadservice.UploadServiceConfig.getNamespace (UploadServiceConfig.kt:74)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationAction (UploadServiceConfig.kt:234)
at net.gotev.uploadservice.UploadServiceConfig.getBroadcastNotificationActionIntentFilter (UploadServiceConfig.kt:248)
at net.gotev.uploadservice.observer.request.NotificationActionsObserver.register (NotificationActionsObserver.kt:31)
at net.gotev.uploadservice.UploadService.onCreate (UploadService.kt:194)
at android.app.ActivityThread.handleCreateService (ActivityThread.java:4641)
Calling init() from the main.ts does not help this particular problem, because error occurs while having this in my main.ts:
import { init } from "@nativescript/background-http";
init();
According to https://github.com/gotev/android-upload-service/issues/510 createNotificationChannel() needs to be called explicitly.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el punto de entrada main.ts y la llamada init() de @nativescript/background-http; después, lee el issue enlazado de android-upload-service sobre la llamada explícita a createNotificationChannel(). Reproduce el fallo de Android y sigue el inicio del servicio; el trabajo estará terminado cuando la IllegalArgumentException reportada ya no se produzca en los dispositivos afectados.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- android, typescript
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100