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

Video Black Screen but audio, join channel is working fine #53

Closed
5 tasks done
codesundar opened this issue Dec 20, 2019 · 39 comments
Closed
5 tasks done

Video Black Screen but audio, join channel is working fine #53

codesundar opened this issue Dec 20, 2019 · 39 comments

Comments

@codesundar
Copy link

codesundar commented Dec 20, 2019

When I download this example project, it's working perfectly.

but when I create a new flutter project & copy the same code, it only shows a black screen for video. I tried this for the last 15 hours but still couldn't figure out

What I did

  • Created New Flutter project
  • Copy the lib folder from this example to the newly created project
  • Updated pubspec.yaml
  • Updated Permissions with AndroidManifest.xml
  • Updated my own APP_ID

After running the app, it shows only a black screen for video. All remaining staff working fine such as audio, join the channel, remove the channel

Flutter Doctor Output:

[✓] Flutter (Channel master, v1.13.4-pre.13, on Mac OS X 10.14.4 18E226, locale en-GB)
 
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 10.2)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.41.0)
[✓] Connected device (2 available)

! Doctor found issues in 1 category.

I found this error when a user joins the channel

Screenshot 2019-12-20 at 7 49 21 PM

@plutoless
Copy link
Contributor

please follow the instructions here https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart#reporting-an-issue
to capture sdk logs and paste in your issue.

@codesundar
Copy link
Author

Here it is
terminal.txt

@codesundar
Copy link
Author

codesundar commented Dec 20, 2019

@plutoless I have also noticed that the black screen is for local video, where the remote video is working fine

@stefanschaller
Copy link

Same here!

@rlee1990
Copy link

@codesundar how did you get the add to log out the SDK logs? I have tried
flutter run -d ce061716d1923703017e
Also tried using adb logcat

@plutoless
Copy link
Contributor

@codesundar
E/AGORA_SDK(23024): ERROR (20:11:15:731 | 163) 23024; [CAMERA2] Camera 1 unavailable
from your log i notice this line. could you pls try switching your camera to see if it fix the issue?

@codesundar
Copy link
Author

@codesundar how did you get the add to log out the SDK logs? I have tried
flutter run -d ce061716d1923703017e
Also tried using adb logcat

Please follow https://github.com/AgoraIO-Community/Agora-Flutter-Quickstart#reporting-an-issue

@codesundar
Copy link
Author

@codesundar
E/AGORA_SDK(23024): ERROR (20:11:15:731 | 163) 23024; [CAMERA2] Camera 1 unavailable
from your log i notice this line. could you pls try switching your camera to see if it fix the issue?

Yes, I have switched the camera too, but still facing the same black screen.

As I mentioned before, this repo example is working perfectly. but when I create my own & replace the code, it's not working.

I think some issue with accessing camera because I tried like this

  • I download this repo & run on one device. (mobile-1)
  • I created a new project & replaced the code & run on another device (mobile-2)
  • Now, I can see a mobile-1 video in mobile-2 but mobile 2 video is not showing in mobile 1 (simply black screen & mobile 2 local video also black screen

@plutoless please help me to fix this asap.

@plutoless
Copy link
Contributor

when you create the new project. have you granted permissions? is your android project settings aligned with our example?

@plutoless
Copy link
Contributor

maybe you can post your project here. i can help take a look directly.

@codesundar
Copy link
Author

maybe you can post your project here. i can help take a look directly.

Yes, This might be good. Give me few mins.

@codesundar
Copy link
Author

Please find attachment

Archive.zip

@plutoless
Copy link
Contributor

plutoless commented Dec 24, 2019

image
@codesundar i just did a quick investigation with my colleague this afternoon. it seems flutter has changed its embedding mechanism to v2 in latest version. in this case somehow registerWith function will be called twice, which leads to problems.

image

you can either,

  1. downgrade in your Manifest.xml from 2 to 1
  2. wait till we upgrade our plugin to support v2

@codesundar
Copy link
Author

@plutoless Thanks for your reply.

  1. can you please help me, how to downgrade?
  2. How long it'll take you to upgrade?

@rlee1990
Copy link

@plutoless it seems like this may be the same issue that I am having. I tried changing the Manifest from 2 to 1 but the app will not build once that is done.

@plutoless
Copy link
Contributor

@rlee1990 @codesundar maybe you can take a look first how you can generate a new project using v1 flutter tool. we are working on upgrading our module to support v2 embedding for the moment. will provide response as soon as we have

@LichKing-2234
Copy link
Contributor

@rlee1990 @codesundar
please remove this code from your MainActivity
GeneratedPluginRegistrant.registerWith(flutterEngine)
new version of flutter will run this function by itself, I think it's a bug of flutter
Tips: keep flutterEmbedding to v2, when you run flutter, the generated file will change

@LichKing-2234
Copy link
Contributor

image

@LichKing-2234
Copy link
Contributor

run registerWith twice, will register all of the plugins twice, so it can cause problems

@codesundar
Copy link
Author

@rlee1990 @codesundar
please remove this code from your MainActivity
GeneratedPluginRegistrant.registerWith(flutterEngine)
new version of flutter will run this function by itself, I think it's a bug of flutter
Tips: keep flutterEmbedding to v2, when you run flutter, the generated file will change

This is working <3

@rlee1990
Copy link

@rlee1990 @codesundar
please remove this code from your MainActivity
GeneratedPluginRegistrant.registerWith(flutterEngine)
new version of flutter will run this function by itself, I think it's a bug of flutter
Tips: keep flutterEmbedding to v2, when you run flutter, the generated file will change

Yes that worked for me also for android now I have to see what happens for IOS.

@rlee1990
Copy link

@LichKing-2234 why is this closed the workaround you provided is not a fix, it will cause other packages that use flutter to break.

@LichKing-2234
Copy link
Contributor

@LichKing-2234
Copy link
Contributor

we will upgrade readme later

@pojoba02
Copy link

that would be much helpful, with the gradle and androidx update

@MarcelEdward
Copy link

My is getting the black screen on ios, on the local.
On android device it is working ok

@LichKing-2234
Copy link
Contributor

@MarcelEdward set io.flutter.embedded_views_preview to YES in info.plist

@github4f
Copy link

Checking on this thread to see if there is any update on SDK to support v2?

@github4f
Copy link

@rlee1990 @codesundar maybe you can take a look first how you can generate a new project using v1 flutter tool. we are working on upgrading our module to support v2 embedding for the moment. will provide response as soon as we have

Any progress?

@AbhijeetBharti
Copy link

@plutoless Hi
Have you upgraded the plugin to v2 ? I'm still facing the same issue (Black Screen).

@LichKing-2234
Copy link
Contributor

@AbhijeetBharti
Copy link

@LichKing-2234 But recently we got new flutter sdk (1.17), is it necessary to switch to other channel ?

@AbhijeetBharti
Copy link

@LichKing-2234 I switched to other channel, and installed the release apk , and app crached.

@JanviPatel1310
Copy link

My is getting the black screen on ios, on the local.
On android device it is working ok

any depencency in pubspec foe making work on android device ??

@anon-000
Copy link

anon-000 commented Mar 2, 2021

@rlee1990 @codesundar
please remove this code from your MainActivity
GeneratedPluginRegistrant.registerWith(flutterEngine)
new version of flutter will run this function by itself, I think it's a bug of flutter
Tips: keep flutterEmbedding to v2, when you run flutter, the generated file will change

mora chaluuunyyyyyyy...
pleaaaseeee help me brotherrrrrrrrr,....

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Mar 2, 2021

@anon-000 our sdk have supported v2 plugin. any problem?

@anon-000
Copy link

anon-000 commented Mar 2, 2021

I have removed that generatedPluginregistrant in MainActivity.kt but still that black screen is showing. I have given all the permissions and also checked the tokens and the app id .

When i downgrade the version of the agorartc plugin to 1.* it's working fine but when i use the latest version or the versions above 3 then it's not working.
RtcLocalSurface becomes black.

Please help me if you can otherwise last option for me is to downgrade the version and use it.

@LichKing-2234
Copy link
Contributor

@anon-000 The 1.x version is out-of-date, if you want to use the 3.x version, pls refer to our example to migrate

@Manishmg3994
Copy link

@rlee1990 @codesundar please remove this code from your MainActivity GeneratedPluginRegistrant.registerWith(flutterEngine) new version of flutter will run this function by itself, I think it's a bug of flutter Tips: keep flutterEmbedding to v2, when you run flutter, the generated file will change

how to remove hat send a image for that

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