Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unresolved reference Activity❓ #1608

Closed
gourav6m17 opened this issue Oct 13, 2023 · 6 comments
Closed

Unresolved reference Activity❓ #1608

gourav6m17 opened this issue Oct 13, 2023 · 6 comments
Labels
question ❓ Question or Support Request Stale

Comments

@gourav6m17
Copy link

I'm using flutter stripe with the 100ms and here in the MainActivity it should be extended with the FlutterFragmentActivity but unexpectly I got the error

Launching lib/main.dart on sdk gphone arm64 in debug mode...
Running Gradle task 'assembleDebug'...
e: file:///Users/xyz/Downloads/seller_support_customer_app-new-branch-to-sultan/android/app/src/main/kotlin/com/rb/sellersuppportuser/MainActivity.kt:22:13 Unresolved reference: activity
e: file:///Users/xyz/Downloads/seller_support_customer_app-new-branch-to-sultan/android/app/src/main/kotlin/com/rb/sellersuppportuser/MainActivity.kt:27:13 Unresolved reference: activity

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > 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 14s
Exception: Gradle task assembleDebug failed with exit code 1

Here is my MainActicvity.kt file code.

package com.example.customer_app


import io.flutter.embedding.android.FlutterFragmentActivity
import android.app.Activity
import android.content.Intent
import android.content.res.Configuration
import android.util.Log
import io.flutter.embedding.android.FlutterActivity
import live.hms.hmssdk_flutter.Constants
import live.hms.hmssdk_flutter.HmssdkFlutterPlugin
import live.hms.hmssdk_flutter.methods.HMSPipAction


class MainActivity: FlutterFragmentActivity() {
    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
         if (requestCode == Constants.SCREEN_SHARE_INTENT_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
            data?.action = Constants.HMSSDK_RECEIVER
            activity.sendBroadcast(data?.putExtra(Constants.METHOD_CALL, Constants.SCREEN_SHARE_REQUEST))
        }

        if (requestCode == Constants.AUDIO_SHARE_INTENT_REQUEST_CODE && resultCode == Activity.RESULT_OK){
            data?.action = Constants.HMSSDK_RECEIVER
            activity.sendBroadcast(data?.putExtra(Constants.METHOD_CALL, Constants.AUDIO_SHARE_REQUEST))
        }

    }
}


@gourav6m17 gourav6m17 added the question ❓ Question or Support Request label Oct 13, 2023
@github-actions
Copy link

Hello! Thank you for filing an issue.

Please include relevant logs or detailed description for faster resolutions.

We really appreciate your contribution!

@Decoder07
Copy link
Contributor

Decoder07 commented Oct 14, 2023

Hi @gourav6m17 you can access the activity using this keyword like below:

Please check the docs here: https://www.100ms.live/docs/flutter/v2/how-to-guides/set-up-video-conferencing/screen-share#android-setup

@Decoder07
Copy link
Contributor

@gourav6m17 is this resolved ?

@gourav6m17
Copy link
Author

Yes, it runs without any errors but I'll test it thoroughly. Thanks for the support.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 16, 2023
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question ❓ Question or Support Request Stale
Projects
None yet
Development

No branches or pull requests

2 participants