JitsiMeetPlugin.kt: (66, 42): Type mismatch: inferred type is Activity? but Activity was expected

Viewed 683

I plugin JitsiMeet but now I'm getting this error after giving all dependencies for this package.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jitsi_meet:compileDebugKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 39s
Exception: Gradle task assembleDebug failed with exit code 1
3 Answers

I actually fixed the bug for them, Hope the CODEOWNER review it. It's just a type_error. It's very common error.

Error You got :

JitsiMeetPlugin.kt C:\src\flutter.pub-cache\hosted\pub.dartlang.org\
jitsi_meet-4.0.0\android\src\main\kotlin\com\gunschu\jitsi_meet\
JitsiMeetPlugin.kt: (66, 42): 
Type mismatch: inferred type is Activity? but Activity was expected

What caused the error :

    constructor(activity: Activity) : this() {
        this.activity = activity
    }

Solution:

constructor(activity: Activity?) : this() {
        this.activity = activity
}

from here: https://github.com/gunschu/jitsi_meet/blob/97154d582969af1155489bd066d280d85054e5c7/jitsi_meet/android/src/main/kotlin/com/gunschu/jitsi_meet/JitsiMeetPlugin.kt#L34

Reference: https://github.com/gunschu/jitsi_meet/issues/393

Goto the JitsiMeetPlugin.kt file and replace all the Activity with Activity? except package name and comment.

How to go JitsiMeetPlugin.kt C:\src\flutter.pub-cache\hosted\pub.dartlang.org\jitsi_meet-4.0.0\android\src\main\kotlin\com\gunschu\jitsi_meet\JitsiMeetPlugin.kt: (66, 42): Type mismatch: inferred type is Activity? but Activity was expected

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':jitsi_meet:compileDebugKotlin'.

Compilation error. See log for more details

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 17s Exception: Gradle task assembleDebug failed with exit code 1

Related