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

Not supported on Kotlin #30

Open
judeosbert opened this issue Jan 1, 2020 · 2 comments
Open

Not supported on Kotlin #30

judeosbert opened this issue Jan 1, 2020 · 2 comments

Comments

@judeosbert
Copy link

When I add this code to my MainActivity.kt in Kotlin, I get the following error,
MainActivity.kt: (10, 5): 'configureFlutterEngine' overrides nothing

My MainActivityFile

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant
import io.flutter.plugins.share.FlutterShareReceiverActivity;

class MainActivity: FlutterShareReceiverActivity() {
    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
        GeneratedPluginRegistrant.registerWith(flutterEngine);
    }
} 

Any help is appreciated. The feature of receiving shared files is critical to my apps functionality.
Thanks in advance

@MperorM
Copy link
Contributor

MperorM commented Feb 3, 2020

I'm running into the same error!

Even flutters own documentation for implementing received intents assume you're running java and not kotlin. Very frustrating!

@MperorM
Copy link
Contributor

MperorM commented Feb 5, 2020

I figured out how to fix this, and it surprisingly had nothing to do with Kotlin. Flutter apps now run Android Embedding V2, whereas this package only works with V1.

I made a pull request which makes the package work with V2.

All you have to do is change the pubspec.yaml to reference my fork instead, so:
share:
git:
url: https://github.com/MperorM/flutter-share.git

I made a pull request as well, so others hopefully don't run into the same problem.
#31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants