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

Missing imports from MainActivity #7

Closed
reducedcarpet opened this issue Aug 28, 2019 · 4 comments
Closed

Missing imports from MainActivity #7

reducedcarpet opened this issue Aug 28, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@reducedcarpet
Copy link

I did all the steps from the wee tutorial on pub.dev / readme.md but I got some big complaints from gradle (building for android obviously) that stopped the build. A tiny amount of googling later and I had to add two imports to MainActivity:

import android.view.ViewTreeObserver;
import android.view.WindowManager;

Shouldn't this have happened automatically? Is this some unique aspect of my build? I am doing some MultiDex shenanigans so I don't know if that has affected it. Sorry this bug report is absolute grabage in terms of detail, but I thought you should know.

@henriquearthur
Copy link
Collaborator

Those two imports are added to MainActivity when you run the package. The package looks for the line public class MainActivity extends FlutterActivity { and add the imports before that line.

Did you modify your class signature? If so, can you post the line?

Thanks for the report.

@henriquearthur henriquearthur added android bug Something isn't working waiting response Further information is requested labels Aug 28, 2019
@reducedcarpet
Copy link
Author

Oh yah, I did:

public class MainActivity extends FlutterFragmentActivity {

I have totes forgot why I had to extend the fragment activity, but it's necessary for another package I am using. On the plus side, your native splashscreen works fine with flutter fragment activity.

@henriquearthur
Copy link
Collaborator

Fixed in v0.1.7 (194591b):

dev_dependencies:
  flutter_native_splash: ^0.1.7

The package looks now only for public class MainActivity extends, which makes it work with custom signatures.

@SimonIT
Copy link

SimonIT commented Jan 9, 2020

I had the same problem with missing imports.
Is it possible that kotlin made it not work?

This is line for the class:
class MainActivity : FlutterActivity() {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants