NativeScript / NativeScript/plugins
[background-http] App crashes due to IllegalArgumentException
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 206
- フォーク
- 123
- 平均マージ
- 2日 1時間
- マージ済み PR(30日)
- 1
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
エントリーポイントの main.ts と @nativescript/background-http の init() 呼び出しから始め、次に createNotificationChannel() を明示的に呼び出すことについてのリンク先の android-upload-service issue を読んでください。Android のクラッシュを再現し、サービスの起動を追跡してください。完了条件は、影響を受けるデバイスで報告された IllegalArgumentException が発生しなくなることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, typescript
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100