Android Kotlin error when app come back from background
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 15/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- mobile, networking
Direzione di ricerca
The crash is a Kotlin null-check (Intrinsics.checkParameterIsNotNull, parameter code) inside the reporter's own PusherRepositoryImp$connect$1.onError, called from WebSocketConnection$5.run in the library's WebSocketConnection.java:238. Start by reading how the library's connection error callback passes its arguments, then check whether the reporter's onError signature declares a nullable code. The issue has no comments and no reproduction, so 'done' is not defined here and it would need a maintainer decision before any change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
version pusher = "2.2.1"
version pusherNotifications = "1.6.2"
Hi...I have a ugly error when app come back from background....
When I detected that the app is going to background I do this
override fun closePrincipalChannelConnection() {
Log.d(TAG,"closePrincipalChannelConnection")
channel?.unbind("chat-message") {
Log.d(TAG,"onEvent")
}
channel?.unbind("new-follower") {
Log.d(TAG,"onEvent")
}
pusher?.unsubscribe(channelName)
}
Then when 5-10 pass and the app come back from background, I mean, now the app is in foreground, then call
override fun connectToGeneral(){
channelName = "presence-$profileId"
channel= pusher?.subscribePresence(channelName, object : PresenceChannelEventListener {
override fun onAuthenticationFailure(message: String, e: Exception) {
Log.d(TAG,String.format("Authentication failure due to [%s], exception was [%s]", message, e))
}
override fun onSubscriptionSucceeded(channelName: String?) {
Log.d(TAG,"onSubscriptionSucceeded$channelName")
}
override fun onEvent(event: PusherEvent?) {
Log.d(TAG,"onEvent"+event?.data)
}
override fun onUsersInformationReceived(channelName: String?, users: MutableSet<User>?) {
Log.d(TAG, "onUsersInformationReceived$channelName${users.toString()}")
}
override fun userUnsubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userUnsubscribed$channelName${user.toString()}")
}
override fun userSubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userSubscribed$channelName${user.toString()}")
}
})
channel?.bind("chat-message", object: PresenceChannelEventListener{
override fun onAuthenticationFailure(message: String?, e: java.lang.Exception?) {
Log.d(TAG,String.format("Authentication failure due to [%s], exception was [%s]", message, e))
}
override fun onUsersInformationReceived(channelName: String?, users: MutableSet<User>?) {
Log.d(TAG, "onUsersInformationReceived$channelName${users.toString()}")
}
override fun userUnsubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userUnsubscribed$channelName${user.toString()}")
}
override fun userSubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userSubscribed$channelName${user.toString()}")
}
override fun onEvent(event: PusherEvent?) {
Log.d(TAG,"onEvent"+event?.data)
logicTypeMessage(PusherEvents.EVENT_TYPE_MESSAGE,event?.data ?:"")
}
override fun onSubscriptionSucceeded(channelName: String?) {
Log.d(TAG,"onSubscriptionSucceeded$channelName")
}
})
channel?.bind("new-follower", object: PresenceChannelEventListener{
override fun onAuthenticationFailure(message: String?, e: java.lang.Exception?) {
Log.d(TAG,String.format("Authentication failure due to [%s], exception was [%s]", message, e))
}
override fun onUsersInformationReceived(channelName: String?, users: MutableSet<User>?) {
Log.d(TAG, "onUsersInformationReceived$channelName${users.toString()}")
}
override fun userUnsubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userUnsubscribed$channelName${user.toString()}")
}
override fun userSubscribed(channelName: String?, user: User?) {
Log.d(TAG, "userSubscribed$channelName${user.toString()}")
}
override fun onEvent(event: PusherEvent?) {
Log.d(TAG,"onEvent"+event?.data)
logicTypeMessage(PusherEvents.EVENT_TYPE_CONNECTIONS,event?.data ?:"")
}
override fun onSubscriptionSucceeded(channelName: String?) {
Log.d(TAG,"onSubscriptionSucceeded$channelName")
}
})
}
The app crash whit the following message
Fatal Exception: java.lang.IllegalArgumentException
Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter code
com.xxx.repository.pusher.PusherRepositoryImp$connect$1.onError (Origen desconocido:7)
com.pusher.client.connection.websocket.WebSocketConnection$5.run (WebSocketConnection.java:238)
com.pusher.client.util.Factory$1.run (Factory.java:119)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
java.lang.Thread.run (Thread.java:764)
whats wrong in my code??
thanks
- Lingua principale
- Java
- Stelle
- 315
- Fork
- 140
- Merge medio
- 11g 5h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pusher/pusher-websocket-java
-
FileNotFoundException thrown when server responds with 400 or aboveForse già presa @RaphaelFakhri l’ha presa 8 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
pusher/pusher-websocket-java#261 ·
-
java.lang.NoClassDefFoundError: com.pusher.client.Pusher$$ExternalSyntheticLambda0 on Android API 21-22 anywayForse già presa @Keith-wright l’ha presa 9 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
pusher/pusher-websocket-java#366 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
pusher/pusher-websocket-java#340 · 3 commenti · 7 reazioni ·
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 8/100
pusher/pusher-websocket-java#311 · 4 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 12/100
pusher/pusher-websocket-java#308 · 2 commenti ·
Tutte le issue di pusher/pusher-websocket-java
Issue simili
-
area: triage theme: undefined
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
jhipster/generator-jhipster#35895 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
oracle/graalvm-reachability-metadata#11659 ·
I maintainer di solito rispondono entro 1 giorno
-
Build failure report and inbox copy miss a proof split by colour codes, which the build log redactsApertabug follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Sanne/incus-spawn#1864 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
openhab/openhab-addons#22135 ·
I maintainer di solito rispondono entro 1 giorno