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

Enable for secondary entrypoint #2

Open
sidetraxaudio opened this issue Mar 28, 2023 · 2 comments
Open

Enable for secondary entrypoint #2

sidetraxaudio opened this issue Mar 28, 2023 · 2 comments

Comments

@sidetraxaudio
Copy link

Using a second entry point to create a floating widget;

@pragma("vm:entry-point")
void overlayMain() async {
// Create the floating action button that persists and takes a screenshot and communicates via isolates
}

Because it remains persistent over other apps, we would like it to be able to capture platform view when pressed while other apps are open but some sort of platform method channel failure happens - presumably because of the secondary entrypoint??

E/MethodChannel#native_screenshot_ext(22864): Failed to handle method call
E/MethodChannel#native_screenshot_ext(22864): java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference
E/MethodChannel#native_screenshot_ext(22864): at jpg.ivan.native_screenshot.NativeScreenshotPlugin.permissionToWrite(NativeScreenshotPlugin.java:395)
E/MethodChannel#native_screenshot_ext(22864): at jpg.ivan.native_screenshot.NativeScreenshotPlugin.handleTakeScreenshot(NativeScreenshotPlugin.java:156)
E/MethodChannel#native_screenshot_ext(22864): at jpg.ivan.native_screenshot.NativeScreenshotPlugin.onMethodCall(NativeScreenshotPlugin.java:138)
E/MethodChannel#native_screenshot_ext(22864): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)

@gdagitrep
Copy link
Owner

gdagitrep commented Mar 30, 2023

Did you add

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

to your AndroidManifest.xml inside android/src/main/ directory?

@sidetraxaudio
Copy link
Author

Yes mate for sure. It works fine in the main entrypoint main(). It just doesn't using a second entrypoint.

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