Code Monkey home page Code Monkey logo

flutter_screen_recording's People

Contributors

arturisvisoft avatar johngalt1717 avatar mikron123 avatar salime45 avatar tnorbury avatar vvalladolidiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_screen_recording's Issues

Error prepare failed

My console:
I/MediaRecorderJNI(22574): setup
I/System.out(22574): Original Resolution
I/System.out(22574): 720 x 1450
I/System.out(22574): Calcule Resolution
I/System.out(22574): 635 x 1280
I/MediaRecorderJNI(22574): setVideoSource(2)
W/MediaRecorder(22574): setOutputFile: path = /storage/emulated/0/DCIM/Title.mp4
E/Media_APM : (22574): isCalledPackage return false
I/MediaRecorderJNI(22574): setVideoSize(635, 1280)
I/MediaRecorderJNI(22574): setVideoEncoder(2)
I/MediaRecorderJNI(22574): setParameter()
I/MediaRecorderJNI(22574): setVideoFrameRate(60)
W/MediaRecorder(22574): prepare: mPath = /storage/emulated/0/DCIM/Title.mp4
I/MediaRecorderJNI(22574): setOutputFile
I/MediaRecorderJNI(22574): prepare
E/MediaRecorder(22574): prepare failed: -2147483648
D/--INIT-RECORDER(22574): prepare failed.

PS C:\Users\Gustavo Huerta\Documents\proyects\screenrecord> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Versión 10.0.18363.836], locale es-CL)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)
• No issues found!

Example app crashes on iOS

Example app crashes on iOS.

Steps to reproduce:

  • Edit pubspecs.yaml of the example comment the local reference to the plug-in library and point to the online repo as per below:
    flutter_screen_recording: ^1.0.8
    # flutter_screen_recording:
    # path: ../
  • Build the example app for iOS.
  • Start recording
  • The app crashes with no logs or error.

The issue was observed on physical device (iPhone 7 plus running iOS 13.5.1) and on a simulator.

Access to individual frames?

Hi!

Is there a way to add access to individual frames of the video in order to process them in some way? I also wouldn't necessarily need to save the video in any place so long as it was a stream of individual frames of the screen.

Thank you

Implement Web

I have web code implemented. It depends on the Platform Interface code pull request I did before.

The pull request is here: #30

There are no tests at this time.

App crashes while stopping recording in iOS

reason :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[AVAssetWriter finishWritingWithCompletionHandler:] Cannot call method when status is 1'

Output recording file found empty

I am trying to use flutter_screen_recording 1.0.3 plugin for screen recording ,
but it is generating empty video file .

Working on plugin is still in progress or there is any issue that is causing this problem ?

Record with audio is not working

This is the error that is printed in the terminal when using a record screen with audio.

D/permissions_handler( 9128): No android specific permissions needed for: 9
I/flutter ( 9128): Foreground on Started
E/MediaRecorder( 9128): setAudioSource called in an invalid state(4)
I/System.out( 9128): Error onMethodCall startRecordScreen
I/System.out( 9128): null
I/flutter ( 9128): current datetime is 2020-10-05 09:37:31.223983

Improving Documentation

Thanks for this very helpful plug-in. A quick suggestion to improve the documentation to specify the minimum SDKs required.

This plug-in requires Android SDK 21+ and iOS 10+

ios simulator

Should it work on simulator ?
I trued several devices and it loses connection on startup.

Flutter Screen Record not recording full screen but only top header of the app

Hello everyone,

The issue right now is so that when I start to record, and stop it, it works, it creates the screen record and the video, but it does NOT record the full screen of it.

Click here for a streamable video link from stramable.com

Since in the plugin, right now, it does not say that i can set video screen size, its a bit strange because it records only top of the app and not the whole full screen.

What i also realized, it recorded only a fraction of it and not whole 15 seconds that i did.

Let me know what I am missing, Thank you.

this is the code:

` startScreenRecord(bool audio) async {
print('test');
bool start = false;
await Future.delayed(const Duration(milliseconds: 1000));

if (audio) {
  print('test2');
  start = await FlutterScreenRecording.startRecordScreenAndAudio(
      "Title" + _time.toString(),
      titleNotification: "dsffad",
      messageNotification: "sdffd");
} else {
  print('test3');
  start = await FlutterScreenRecording.startRecordScreen("Title2",
      titleNotification: "dsffad", messageNotification: "sdffd");
}

if (start) {
  print('start');
  setState(() => recording = !recording);
}

return start;

} stopScreenRecord() async { print('stop'); String path = await FlutterScreenRecording.stopRecordScreen; setState(() { print('setState'); recording = !recording; }); print("Opening video"); print(path); OpenFile.open(path); } }

Crash just after stared recording

Hi, trying for an android app.
App closes just after accepting the permission after calling startScreenRecord function without audio.
It does nothing if using audio.
Any solution?

Unhandled exception ( attempt to invokde virtual method startActivityForResult() on NULL )

I am using flutter_screen_recording: ^1.0.1 for flutter screen recording application , but i am getting the following exception by calling FlutterScreenRecording.startRecordScreen , any help ?

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void android.app.Activity.startActivityForResult(android.content.Intent, int, android.os.Bundle)' on a null object reference, null)
E/flutter (20318): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (20318): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (20318): <asynchronous suspension>
E/flutter (20318): #2      FlutterScreenRecording.startRecordScreen (package:flutter_screen_recording/flutter_screen_recording.dart:15:40)
E/flutter (20318): #3      _MyAppState.startScreenRecord (package:flutter_recording/main.dart:101:48)
E/flutter (20318): #4      _MyAppState.build.<anonymous closure> (package:flutter_recording/main.dart:90:15)
E/flutter (20318): #5      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter (20318): #6      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
E/flutter (20318): #7      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (20318): #8      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter (20318): #9      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter (20318): #10     BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:199:7)
E/flutter (20318): #11     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:467:9)
E/flutter (20318): #12     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter (20318): #13     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:117:9)
E/flutter (20318): #14     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (20318): #15     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:115:18)
E/flutter (20318): #16     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:7)
E/flutter (20318): #17     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (20318): #18     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (20318): #19     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (20318): #20     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (20318): #21     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (20318): #22     _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter (20318): #23     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (20318): #24     _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter (20318): #25     _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter (20318): #26     _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)

MediaRecorder prepare failed on Android

Hi, I'm having trouble getting this plugin to work on Android devices.

I get the error below, I believe related to the output file. I'm no Android expert, and hours of search on Google about MediaRecorder, getExternalStoragePublicDirectory, and setOutpuFile gives me no clearer clue as to why this is happening. So just want to ask, anything come to mind why this error may occur?

Screen Shot 2020-04-02 at 02 11 16

My device information:
Samsung Galaxy Tab A (2019)
Android 9 (API 28)

I've also used permission_handler plugin to request permission for external storage.

Thank you very much.

execution failed for task ':flutter_screen_recording:compiledebugkotlin'.

Hello Guys,
Thanks for this plugin.

I updated Gradle to new version and now, this issue appears :
"execution failed for task ':flutter_screen_recording:compiledebugkotlin'".

I tried many solutions but nothing works :

  • Update 'classpath 'com.android.tools.build:gradle:3.5.0' to 4.1.1
  • Update Kotlin from 1.3.50 to 1.3.72
  • Run Flutter clean
  • Run Flutter pub cache repair
  • Delete pubspec.lock + Gradle (folder)
  • Invalidate cache + wipe data from android device
  • Test on device with Android 11.0, Android 10.0, Android 9.0

After 1 day on it, i decided to cut part of code. But i really want to use it.
What can i do ? or What can you do (about updating package with new android updates) ?

Thanks for help.

Have a nice day,
Guillaume

Get Error: Owner died when i try to delete saved file use File Api

that's ok before delete it.
here is the code create file.

_startRecordScreen() async {
    screenRecordStart = await FlutterScreenRecording.startRecordScreen(screenFilename);
    _timing();
  }

_stopRecordScreen() async {
    screenAbsFilePath = await FlutterScreenRecording.stopRecordScreen;
    print('$screenAbsFilePath');
}

and when i try to delete it use file api in real phone.

File screenFile = File(face.filePath);
await screenFile.delete();

i would get this error

FileSystemException: Cannot delete file, path = '/storage/emulated/0/DCIM/8d2b429d-d8c7-424f-b668-8ad20d8cd5c2.mp4' (OS Error: Owner died, errno = 130)

what should i do ?

Some advice

It is recommended to add these to android/build.gradle.

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }	    
    }
}
dependencies {
    implementation 'com.github.HBiSoft:HBRecorder:0.1.4'
}

record in background iOS

In iOS the app pause recording when the app goes in the background and then back to the app it continues recording

How to suppress warning "Exposing sensitive info during casting/recording"

Thanks for this useful plugin. I'm running it on the Android Emulator built for Pixel 3a and Android api 29, i.e. Android 10. It works fine except that a warning dialog always appears. The title is "Exposing sensitive info during casting/recording". Is there a way to suppress that programmatically?

Edit: The same thing happens on a Samsung Galaxy S9 running Android 10. I was not able to find a place to turn off this warning in Settings. I'd like to be able to control it from an app.

Screen recording not working

I am using Flutter v1.12.13+hotfix.8 (stable channel) and Android SDK version 29.0.3 . The play button is not doing anything and there is no error in the console.

low audio quality

On both platforms record audio is being recorded in low quality.

In Android I fixed it by using:

mMediaRecorder?.setAudioSource(MediaRecorder.AudioSource.VOICE_RECOGNITION); mMediaRecorder?.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); mMediaRecorder?.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); mMediaRecorder?.setAudioEncodingBitRate(16*44100); mMediaRecorder?.setAudioSamplingRate(44100);

iOS is still low quality.
The simple test it to record using the device's Camera app, and compare the quality of the voice.

Screen Size Issues

Two problems show up when using the plugin on a physical Galaxy S9 running Android 10, i.e. not an emulator. Both problems have to do with the way the plugin configures the screen size to MediaRecorder.

To Duplicate

  1. Run the example project with the phone in portait orientation and press the "Record Screen" button. The log shows a call to MediaRecorder.setVideoSize(1280, 720). Press the "Stop" button.
  2. Recording is successful. Use the back button to return to the example app screen.
  3. Press "Record Screen" button again. The log shows a call to MediaRecorder.setVideoSize(1280, 2631) -- a different size. This is Problem number 1.
  4. The log also shows error messages: prepare failed: -2147483648. Recording does not take place. This is Problem number 2.

Configuration

Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.7 19H2, locale en-US)

App crashes when screen recording starts

The app crashes while using this package. When I call the startRecordScreen(name) function, as in the package, i see a native alert dialog as below.
Screenshot_20200603-120343~2

When i click start now as on the dialog, the app crashes giving the below error:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=333, result=-1, data=Intent { (has extras) }} to activity {com.script.scriptGames/com.script.scriptGames.MainActivity}: java.lang.IllegalStateException: failed to get surface E/AndroidRuntime(31376): at android.app.ActivityThread.deliverResults(ActivityThread.java:5080) E/AndroidRuntime(31376): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5121) E/AndroidRuntime(31376): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) E/AndroidRuntime(31376): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) E/AndroidRuntime(31376): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) E/AndroidRuntime(31376): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2183) E/AndroidRuntime(31376): at android.os.Handler.dispatchMessage(Handler.java:107) E/AndroidRuntime(31376): at android.os.Looper.loop(Looper.java:241) E/AndroidRuntime(31376): at android.app.ActivityThread.main(ActivityThread.java:7617) E/AndroidRuntime(31376): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(31376): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E/AndroidRuntime(31376): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:941) E/AndroidRuntime(31376): Caused by: java.lang.IllegalStateException: failed to get surface

Flutter: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION

Andriod Q, need a Foreground service request now. Please make this update. I'm about to publish my application to playstore but due to this issue, I'm not able to.
Exception in Android Q (10)

compileSdkVersion 29
targetSdkVersion 29

I know after downgrading to compileSdkVersion 28. The app will work but then I will not be able to upload it to the play store.

D/AndroidRuntime( 5005): Shutting down VM
E/AndroidRuntime( 5005): FATAL EXCEPTION: main
E/AndroidRuntime( 5005): Process: com.example.screenrecordtest, PID: 5005
E/AndroidRuntime( 5005): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=333, result=-1, data=Intent { (has extras) }} to activity {com.example.screenrecordtest/com.example.screenrecordtest.MainActivity}: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime( 5005):        at android.app.ActivityThread.deliverResults(ActivityThread.java:5015)
E/AndroidRuntime( 5005):        at android.app.ActivityThread.handleSendResult(ActivityThread.java:5056)
E/AndroidRuntime( 5005):        at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime( 5005):        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime( 5005):        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 5005):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
E/AndroidRuntime( 5005):        at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 5005):        at android.os.Looper.loop(Looper.java:223)
E/AndroidRuntime( 5005):        at android.app.ActivityThread.main(ActivityThread.java:7656)
E/AndroidRuntime( 5005):        at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5005):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
E/AndroidRuntime( 5005):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
E/AndroidRuntime( 5005): Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime( 5005):        at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
E/AndroidRuntime( 5005):        at android.os.Parcel.createException(Parcel.java:2357)
E/AndroidRuntime( 5005):        at android.os.Parcel.readException(Parcel.java:2340)
E/AndroidRuntime( 5005):        at android.os.Parcel.readException(Parcel.java:2282)
E/AndroidRuntime( 5005):        at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231)
E/AndroidRuntime( 5005):        at android.media.projection.MediaProjection.<init>(MediaProjection.java:59)
E/AndroidRuntime( 5005):        at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:119)        
E/AndroidRuntime( 5005):        at com.isvisoft.flutter_screen_recording.FlutterScreenRecordingPlugin.onActivityResult(FlutterScreenRecordingPlugin.kt:66)
E/AndroidRuntime( 5005):        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEngineConnectionRegistry.java:739)
E/AndroidRuntime( 5005):        at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.onActivityResult(FlutterEngineConnectionRegistry.java:426)
E/AndroidRuntime( 5005):        at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:652)
E/AndroidRuntime( 5005):        at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:618)
E/AndroidRuntime( 5005):        at android.app.Activity.dispatchActivityResult(Activity.java:8310)
E/AndroidRuntime( 5005):        at android.app.ActivityThread.deliverResults(ActivityThread.java:5008)
E/AndroidRuntime( 5005):        ... 11 more
E/AndroidRuntime( 5005): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime( 5005):        at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:479)
E/AndroidRuntime( 5005):        at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135)
E/AndroidRuntime( 5005):        at android.os.Binder.execTransactInternal(Binder.java:1154)
E/AndroidRuntime( 5005):        at android.os.Binder.execTransact(Binder.java:1123)
E/AndroidRuntime( 5005):
I/Process ( 5005): Sending signal. PID: 5005 SIG: 9

NoSuchMethodError on starting recording

When I use startRecordScreen, app crashes and I get an error :

java.lang.NoSuchMethodError: No virtual method onActivityResult(ILandroid/content/Intent;Landroid/app/Activity;)V in class Lcom/hbisoft/hbrecorder/HBRecorder; or its super classes (declaration of 'com.hbisoft.hbrecorder.HBRecorder' appears in /data/app/com.....

I'm using the exact same code as in the example given

Support for audio recording.

Hello guys .
This plugin is recording video successfully . But it is not able to record audio. Can you please add this feature?
Thanks

permission denied error

Hi. I want to test screen recording but I got this error.
I put exactly the same as Readme file and checked storage permission with permission handler.

I/MediaRecorderJNI(14754): setup
I/MediaRecorderJNI(14754): setVideoSource(2)
I/MediaRecorderJNI(14754): setVideoEncoder(2)
I/System.out(14754): 1280 720
I/MediaRecorderJNI(14754): setVideoSize(1280, 720)
I/MediaRecorderJNI(14754): setVideoFrameRate(30)
I/System.out(14754): file --- /storage/emulated/0/DCIM/test.mp4
I/MediaRecorderJNI(14754): setParameter()
I/System.out(14754): Error onMethodCall startRecordScreen
I/System.out(14754): /storage/emulated/0/DCIM/test.mp4: open failed: EACCES (Permission denied)

Support more platforms

First of all, thank you for the awesome plugin :)

As flutter grows, we'd like this plugin to grow with it. It'd be great to have more supported platforms and a better api in the plugin.

Currently supported platforms:

  • Android
  • iOS
  • macOS
  • web

It'd also be great if we could take a screenshot using the plugin :)

can not work in the example

when I press the button which named record screen,it happen below.
PS: my flutter is 1.17.1, my phone's android version is 10

I/System.out(28700): Scaled Density
I/System.out(28700): 3.0
I/System.out(28700): Original Resolution
I/System.out(28700): 1080 x 2208
I/System.out(28700): Calcule Resolution
I/System.out(28700): 939 x 1920
W/cording_example(28700): type=1400 audit(0.0:3036725): avc: granted { read write } for pid=28700 name="Title.mp4" dev="sdcardfs" ino=280996 scontext=u:r:untrusted_app_27:s0:c143,c259,c512,c768 tcontext=u:object_r:sdcardfs:s0 tclass=file
E/MediaRecorder(28700): prepare failed: -2147483648
D/--INIT-RECORDER(28700): prepare failed.
I/System.out(28700): Error startRecordScreen
I/System.out(28700): prepare failed.
D/HwFrameworkSecurityPartsFactory(28700): HwFrameworkSecurityPartsFactory in.
I/HwFrameworkSecurityPartsFactory(28700): add HwFrameworkSecurityPartsFactory to memory.
D/ZrHung.AppEyeUiProbe(28700): not watching, wait.
D/ZrHung.AppEyeUiProbe(28700): restart watching

APP HAS STOPPED by calling FlutterScreenRecording.startRecordScreen

I want to record screen on flutter app by using flutter_screen_recording plugin ,
but when i call startRecordScreen() mehtod , app become crashed ,
error message showing like this:
FATAL EXCEPTION: main
E/AndroidRuntime( 8312): Process: com.example.my_screen_recording, PID: 8312
E/AndroidRuntime( 8312): java.lang.NoSuchMethodError: **No virtual method onActivityResult(ILandroid/content/Intent;Landroid/app/Activity;)**V in class Lcom/hbisoft/hbrecorder/HBRecorder; or its super classes (declaration of 'com.hbisoft.hbrecorder.HBRecorder' appears in /data/app/com.example.my_screen_recording-1/base.apk)
E/AndroidRuntime( 8312): at com.isvisoft.flutter_screen_recording.FlutterScreenRecordingPlugin.onActivityResult(FlutterScreenRecordingPlugin.kt:70)

Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=333, result=-1, data=Intent { (has extras) }} to activity {com.isvisoft.flutter_screen_recording_example/com.isvisoft.flutter_screen_recording_example.MainActivity}: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime(29458): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845)
E/AndroidRuntime(29458): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886)
E/AndroidRuntime(29458): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(29458): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(29458): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(29458): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
E/AndroidRuntime(29458): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(29458): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(29458): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/AndroidRuntime(29458): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(29458): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/AndroidRuntime(29458): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(29458): Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime(29458): at android.os.Parcel.createException(Parcel.java:2071)
E/AndroidRuntime(29458): at android.os.Parcel.readException(Parcel.java:2039)
E/AndroidRuntime(29458): at android.os.Parcel.readException(Parcel.java:1987)
E/AndroidRuntime(29458): at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231)
E/AndroidRuntime(29458): at android.media.projection.MediaProjection.(MediaProjection.java:58)
E/AndroidRuntime(29458): at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:104)
E/AndroidRuntime(29458): at com.isvisoft.flutter_screen_recording.FlutterScreenRecordingPlugin.onActivityResult(FlutterScreenRecordingPlugin.kt:71)
E/AndroidRuntime(29458): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:204)
E/AndroidRuntime(29458): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:131)
E/AndroidRuntime(29458): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:142)
E/AndroidRuntime(29458): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(29458): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(29458): ... 11 more
E/AndroidRuntime(29458): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(29458): at com.android.server.media.projection.MediaProjectionManagerService$MediaProjection.start(MediaProjectionManagerService.java:476)
E/AndroidRuntime(29458): at android.media.projection.IMediaProjection$Stub.onTransact(IMediaProjection.java:135)
E/AndroidRuntime(29458): at android.os.Binder.execTransactInternal(Binder.java:1021)
E/AndroidRuntime(29458): at android.os.Binder.execTransact(Binder.java:994)
E/AndroidRuntime(29458): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
E/AndroidRuntime(29458): Caused by: java.lang.SecurityException: Media projections require a foreground service of type ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION
E/AndroidRuntime(29458): at android.os.Parcel.createException(Parcel.java:2071)
E/AndroidRuntime(29458): at android.os.Parcel.readException(Parcel.java:2039)
E/AndroidRuntime(29458): at android.os.Parcel.readException(Parcel.java:1987)
E/AndroidRuntime(29458): at android.media.projection.IMediaProjection$Stub$Proxy.start(IMediaProjection.java:231)
E/AndroidRuntime(29458): at android.media.projection.MediaProjection.(MediaProjection.java:58)
E/AndroidRuntime(29458): at android.media.projection.MediaProjectionManager.getMediaProjection(MediaProjectionManager.java:104)
E/AndroidRuntime(29458): at com.isvisoft.flutter_screen_recording.FlutterScreenRecordingPlugin.onActivityResult(FlutterScreenRecordingPlugin.kt:71)
E/AndroidRuntime(29458): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:204)
E/AndroidRuntime(29458): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:131)
E/AndroidRuntime(29458): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:142)
E/AndroidRuntime(29458): at android.app.Activity.dispatchActivityResult(Activity.java:8110)
E/AndroidRuntime(29458): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838)
E/AndroidRuntime(29458): ... 11 more

How to get permission?

When i install example of flutter_screen_recording. It automatically popup for permission. But when i request permission after adding dependency app does not popup for permission.
I check code for getting permission in example but didn't found any. I'm wondering how the example get permission.
I know "Flutter_Screen_Recorder do not request permissions necessary.".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.