AgoraIO-Extensions / Agora-Flutter-SDK

Flutter plugin of Agora RTC SDK for Android/iOS/macOS/Windows

Home Page:https://pub.dev/packages/agora_rtc_engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Access denied finding property "vendor.camera.aux.packagelist"

Wreck-X opened this issue · comments

Version of the agora_rtc_engine

6.3.1

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows
  • Web

Steps to reproduce

create a fresh flutter project
copy the example code
run it on nothing 2

Expected results

should work with camera

Actual results

W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"
W/libc    (21600): Access denied finding property "vendor.camera.aux.packagelist"```

### Code sample

<details open><summary>Code sample</summary>

```dart
import 'dart:async';

import 'package:agora_rtc_engine/agora_rtc_engine.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';

const appId =" ";
const token = "<-- Insert Token -->";
const channel = "<-- Insert Channel Name -->";

void main() => runApp(const MaterialApp(home: MyApp()));

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int? _remoteUid;
  bool _localUserJoined = false;
  late RtcEngine _engine;

  @override
  void initState() {
    super.initState();
    initAgora();
  }

  Future<void> initAgora() async {
    // retrieve permissions
    await [Permission.microphone, Permission.camera].request();

    //create the engine
    _engine = createAgoraRtcEngine();
    await _engine.initialize(const RtcEngineContext(
      appId: appId,
      channelProfile: ChannelProfileType.channelProfileLiveBroadcasting,
    ));

    _engine.registerEventHandler(
      RtcEngineEventHandler(
        onJoinChannelSuccess: (RtcConnection connection, int elapsed) {
          debugPrint("local user ${connection.localUid} joined");
          setState(() {
            _localUserJoined = true;
          });
        },
        onUserJoined: (RtcConnection connection, int remoteUid, int elapsed) {
          debugPrint("remote user $remoteUid joined");
          setState(() {
            _remoteUid = remoteUid;
          });
        },
        onUserOffline: (RtcConnection connection, int remoteUid,
            UserOfflineReasonType reason) {
          debugPrint("remote user $remoteUid left channel");
          setState(() {
            _remoteUid = null;
          });
        },
        onTokenPrivilegeWillExpire: (RtcConnection connection, String token) {
          debugPrint(
              '[onTokenPrivilegeWillExpire] connection: ${connection.toJson()}, token: $token');
        },
      ),
    );

    await _engine.setClientRole(role: ClientRoleType.clientRoleBroadcaster);
    await _engine.enableVideo();
    await _engine.startPreview();

    await _engine.joinChannel(
      token: token,
      channelId: channel,
      uid: 0,
      options: const ChannelMediaOptions(),
    );
  }

  @override
  void dispose() {
    super.dispose();

    _dispose();
  }

  Future<void> _dispose() async {
    await _engine.leaveChannel();
    await _engine.release();
  }

  // Create UI with local view and remote view
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Agora Video Call'),
      ),
      body: Stack(
        children: [
          Center(
            child: _remoteVideo(),
          ),
          Align(
            alignment: Alignment.topLeft,
            child: SizedBox(
              width: 100,
              height: 150,
              child: Center(
                child: _localUserJoined
                    ? AgoraVideoView(
                        controller: VideoViewController(
                          rtcEngine: _engine,
                          canvas: const VideoCanvas(uid: 0),
                        ),
                      )
                    : const CircularProgressIndicator(),
              ),
            ),
          ),
        ],
      ),
    );
  }

  // Display remote user's video
  Widget _remoteVideo() {
    if (_remoteUid != null) {
      return AgoraVideoView(
        controller: VideoViewController.remote(
          rtcEngine: _engine,
          canvas: VideoCanvas(uid: _remoteUid),
          connection: const RtcConnection(channelId: channel),
        ),
      );
    } else {
      return const Text(
        'Please wait for remote user to join',
        textAlign: TextAlign.center,
      );
    }
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[wreck@fedora agoratesting]$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.0, on Fedora Linux 38 (Workstation Edition) 6.8.7-100.fc38.x86_64, locale en_IN.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✗] Linux toolchain - develop for Linux desktop
    ✗ clang++ is required for Linux development.
      It is likely available from your distribution (e.g.: apt install clang), or can be downloaded from https://releases.llvm.org/
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.84.2)
[✓] Connected device (2 available)
[✓] Network resources

Have you run the example on 2 devices?

i tried it on Realme9 pro plus as well had something else as the error, but the camera remained in not working condition. might take a few days for me to get that phone again to reproduce it so cant share it rn.

Can you share the API logs?

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please raise a new issue.