jitsi / jitsi-meet-sdk-samples

Jitsi Meet mobile SDK examples (Android, iOS and React Native)
Apache License 2.0
281 stars 239 forks source link

Android: Call to JitsiMeetActivity.launch(this, options) with pip enable crash second time when entering pip mode #85

Open jesusjav opened 3 years ago

jesusjav commented 3 years ago

Hi, i'm trying to integrate this into my app and basically I'm having several issues mostly second time i launch the Jitsi activity. It happens as well with demo apps in pip mode.

it crash as welll on react JitsiMeetActivityDelegate.onHostResume(this) when no press the hang out button(onbachpresses) and then open quick.

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'org.jitsi.meet.sdk.JitsiMeetView org.jitsi.meet.sdk.JitsiMeetFragment.getJitsiView()' on a null object reference

Step to reproduce.

  1. Launch JitsiMeetActivity.launch(this, options) with (pip.enabled, true) -> it open the conference.

  2. The trick here, don't close the conference call and press back botton instead, it minimize in pic mode, perfect.

  3. Now, if i call again JitsiMeetActivity.launch(this, options) because i might need to change to a diferent room , the app crash.

So basically I'm thinking it doent support changing to another room with the same singletask when it should?

I hope someone can have a look

Samsung s8 Huawie P30

@AndroidEntryPoint class JitsiActivity : AppCompatActivity() {

lateinit var room: String

var finishActivity: Boolean = true

@Inject
lateinit var userRepository: UserRepository

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)

    JitsiMeet.showDevOptions()

    val builder1 = JitsiMeetConferenceOptions.Builder()
    builder1.setAudioMuted(false)
    builder1.setVideoMuted(false)
    builder1.setFeatureFlag("pip.enabled", true)

    JitsiMeet.setDefaultConferenceOptions(builder1.build())

    room = intent.getStringExtra(EXTRA_ROOM) ?: "General"

    val close = intent?.getBooleanExtra(EXTRA_CLOSE_CONFERENCE, false);

    close?.let {
        if(it){
        //    leave()
        //    finishAndRemoveTask()
        }
    }

    val builder = JitsiMeetConferenceOptions.Builder()
            .setRoom("https://meet.jit.si/" + room)
    builder.setAudioMuted(false)
    builder.setVideoMuted(false)
    builder.setFeatureFlag("pip.enabled", true)
    val jitsiMeetUserInfo = JitsiMeetUserInfo()
    jitsiMeetUserInfo.displayName = "Welcome"
    builder.setUserInfo(jitsiMeetUserInfo)
    val options = builder.build()

    JitsiMeetActivity.launch(this, options)
    finish()
}

}

e4basil commented 3 years ago

any solution ??

saghul commented 3 years ago

Can you paste the logs when the crash happens?