AgoraIO-Community / Agora-Flutter-Quickstart

Quickstart guide for the Agora Flutter SDK(Android/iOS)
MIT License
507 stars 193 forks source link

White screen on one to one video call only in release android build. #103

Closed sourab-sasan-sharma closed 4 years ago

sourab-sasan-sharma commented 4 years ago

I am getting white screen ONLY in android device ONLY for release build. One to One video call is working fine for iOS simulator and real iOS device and in Android debug build too for emulator and real device. White screen is only happening when I create release build for android.

Screenshot

flutter doctor


[✓] Flutter (Channel master, v1.18.0-7.0.pre.34, on Mac OS X 10.15.3 19D76, locale en-IN)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.6)
[!] VS Code (version 1.43.2)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)

! Doctor found issues in 1 category.

Manifest File

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.video.live">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <uses-permission android:name="android.permission.BLUETOOTH" />

    <uses-feature android:name="android.hardware.camera" />

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label=“VideoLive"
        android:icon="@mipmap/ic_launcher"
        tools:replace="android:appComponentFactory"
        android:appComponentFactory="android.support.v4.app.CoreComponentFactory">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
            <intent-filter>
               <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>

MainActivity.java

package com.video.live;

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;

public class MainActivity extends FlutterActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        GeneratedPluginRegistrant.registerWith(this);
    }
}

app/build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
    compileSdkVersion 28
    sourceSets {
        main.java.srcDirs += 'src/main/java'
    }
    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        applicationId "com.video.live"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
       ndk {
            abiFilters 'armeabi-v7a', 'x86' ,'arm64-v8a'
        }
    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled false
            shrinkResources false
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
apply plugin: 'com.google.gms.google-services'

build.gradle

buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle.properties

org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

proguard-rules.pro

-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-keep class io.agora.**{*;}

pubspec.yaml

name: videolive
description: A new Flutter project.
version: 1.0.0+1

environment:
  sdk: '>=2.5.2 <3.0.0'

dependencies:
  flutter:
    sdk: flutter

  image: ^2.1.12
  cupertino_icons: ^0.1.3
  http: 0.12.0+4
  provider: ^4.0.5
  intl: ^0.16.1
  shared_preferences: ^0.5.6+3
  image_picker: 0.6.5
  line_icons: ^0.2.0
  flutter_video_compress: 0.3.7+8
  video_player: ^0.10.8+1
  flutter_luban: 0.1.11
  path_provider: 1.6.5
  chewie: 0.9.10
  firebase_messaging: 6.0.13
  agora_rtc_engine: 1.0.10
  permission_handler: 5.0.0
  cached_network_image: 2.1.0+1

flutter:
  uses-material-design: true

  assets:
    - assets/images/splash.jpg

Call Screen


class CallScreen extends StatefulWidget {
  final Call call;

  CallScreen({
    @required this.call,
  });

  @override
  _CallScreenState createState() => _CallScreenState();
}

class _CallScreenState extends State<CallScreen> {
  static final _users = <int>[];
  final _infoStrings = <String>[];
  bool muted = false;

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

  Future<void> initializeAgora() async {
    if (APP_ID.isEmpty) {
      setState(() {
        _infoStrings.add(
          'APP_ID missing, please provide your APP_ID in settings.dart',
        );
        _infoStrings.add('Video Engine is not starting');
      });
      return;
    }
    await _initAgoraRtcEngine();
    _addAgoraEventHandlers();
    await AgoraRtcEngine.enableWebSdkInteroperability(true);
    await AgoraRtcEngine.setChannelProfile(ChannelProfile.Communication);
    await AgoraRtcEngine.setParameters(
        '''{\"che.video.lowBitRateStreamParameter\":{\"width\":320,\"height\":180,\"frameRate\":15,\"bitRate\":140}}''');
    await AgoraRtcEngine.setParameters("{\"rtc.log_filter\": 65535}");
    await AgoraRtcEngine.joinChannel(null, widget.call.channelId, null, 0);
  }

  Future<void> _initAgoraRtcEngine() async {
    await AgoraRtcEngine.create(APP_ID);
    await AgoraRtcEngine.enableVideo();
  }

  /// Add agora event handlers
  void _addAgoraEventHandlers() {
    AgoraRtcEngine.onError = (dynamic code) {
      setState(() {
        final info = 'onError: $code';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onJoinChannelSuccess = (
      String channel,
      int uid,
      int elapsed,
    ) {
      setState(() {
        final info = 'onJoinChannel: $channel, uid: $uid';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onUserJoined = (int uid, int elapsed) {
      setState(() {
        final info = 'onUserJoined: $uid';
        _infoStrings.add(info);
        _users.add(uid);
      });
    };

    AgoraRtcEngine.onUpdatedUserInfo = (AgoraUserInfo userInfo, int i) {
      setState(() {
        final info = 'onUpdatedUserInfo: ${userInfo.toString()}';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onRejoinChannelSuccess = (String string, int a, int b) {
      setState(() {
        final info = 'onRejoinChannelSuccess: $string';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onUserOffline = (int a, int b) async {
      _endCall();
      setState(() {
        final info = 'onUserOffline: a: ${a.toString()}, b: ${b.toString()}';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onRegisteredLocalUser = (String s, int i) {
      setState(() {
        final info = 'onRegisteredLocalUser: string: s, i: ${i.toString()}';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onLeaveChannel = () {
      setState(() {
        _infoStrings.add('onLeaveChannel');
        _users.clear();
        _endCall();
      });
    };

    AgoraRtcEngine.onConnectionLost = () {
      setState(() {
        final info = 'onConnectionLost';
        _infoStrings.add(info);
      });
    };

    AgoraRtcEngine.onUserOffline = (int uid, int reason) {
      // if call was picked
      setState(() {
        final info = 'userOffline: $uid';
        _infoStrings.add(info);
        _users.remove(uid);
        _leaveChannel();
      });
    };

    AgoraRtcEngine.onFirstRemoteVideoFrame = (
      int uid,
      int width,
      int height,
      int elapsed,
    ) {
      setState(() {
        final info = 'firstRemoteVideo: $uid ${width}x $height';
        _infoStrings.add(info);
      });
    };
  }

  List<Widget> _getRenderViews() {
    final List<AgoraRenderWidget> list = [
      AgoraRenderWidget(0, local: true, preview: true),
    ];
    _users.forEach((int uid) => list.add(AgoraRenderWidget(uid)));
    return list;
  }

  Widget _videoView(view) {
    return Expanded(child: Container(child: view));
  }

  Widget _expandedVideoRow(List<Widget> views) {
    views.map<Widget>(_videoView);

    final wrappedViews = views.map<Widget>(_videoView).toList();
    return Expanded(
      child: Row(
        children: wrappedViews,
      ),
    );
  }

  Widget _positionedVideoRow(List<Widget> views) {
    views.map<Widget>(_videoView);

    final wrappedViews = views.map<Widget>(_videoView).toList();
    return Positioned(
      height: 200,
      width: 120,
      left: 10.0,
      bottom: 25.0,
      child: Row(
        children: wrappedViews,
      ),
    );
  }

  Widget _viewRows() {
    final views = _getRenderViews();
    switch (views.length) {
      case 1:
        return Container(
            child: Column(
          children: <Widget>[_videoView(views[0])],
        ));
      case 2:
        return Stack(
          children: <Widget>[
            _expandedVideoRow([views[1]]),
            _positionedVideoRow([views[0]])
          ],
        );
      default:
    }
    return Container();
  }

  Widget _panel() {
    return Container(
      padding: const EdgeInsets.symmetric(vertical: 48),
      alignment: Alignment.bottomCenter,
      child: FractionallySizedBox(
        heightFactor: 0.5,
        child: Container(
          padding: const EdgeInsets.symmetric(vertical: 48),
          child: ListView.builder(
            reverse: true,
            itemCount: _infoStrings.length,
            itemBuilder: (BuildContext context, int index) {
              if (_infoStrings.isEmpty) {
                return null;
              }
              return Padding(
                padding: const EdgeInsets.symmetric(
                  vertical: 3,
                  horizontal: 10,
                ),
                child: Row(
                  mainAxisSize: MainAxisSize.min,
                  children: [
                    Flexible(
                      child: Container(
                        padding: const EdgeInsets.symmetric(
                          vertical: 2,
                          horizontal: 5,
                        ),
                        decoration: BoxDecoration(
                          color: Colors.yellowAccent,
                          borderRadius: BorderRadius.circular(5),
                        ),
                        child: Text(
                          _infoStrings[index],
                          style: TextStyle(color: Colors.blueGrey),
                        ),
                      ),
                    )
                  ],
                ),
              );
            },
          ),
        ),
      ),
    );
  }

  void _onToggleBlur() {
    setState(() {
      muted = !muted;
    });
  }

  void _onSwitchCamera() {
    AgoraRtcEngine.switchCamera();
  }

  /// Toolbar layout
  Widget _toolbar() {
    return Container(
      alignment: Alignment.bottomCenter,
      padding: const EdgeInsets.symmetric(vertical: 48),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          RawMaterialButton(
            onPressed: _onToggleBlur,
            child: Icon(
              muted ? Icons.videocam : Icons.videocam_off,
              color: muted ? Colors.white : Colors.blueAccent,
              size: 20.0,
            ),
            shape: CircleBorder(),
            elevation: 2.0,
            fillColor: muted ? Colors.blueAccent : Colors.white,
            padding: const EdgeInsets.all(12.0),
          ),
          RawMaterialButton(
            onPressed: _leaveChannel,
            child: Icon(
              Icons.call_end,
              color: Colors.white,
              size: 35.0,
            ),
            shape: CircleBorder(),
            elevation: 2.0,
            fillColor: Colors.redAccent,
            padding: const EdgeInsets.all(15.0),
          ),
          RawMaterialButton(
            onPressed: _onSwitchCamera,
            child: Icon(
              Icons.switch_camera,
              color: Colors.blueAccent,
              size: 20.0,
            ),
            shape: CircleBorder(),
            elevation: 2.0,
            fillColor: Colors.white,
            padding: const EdgeInsets.all(12.0),
          )
        ],
      ),
    );
  }

  Future<void> _leaveChannel() async {
    AgoraRtcEngine.leaveChannel();
  }

  Future<void> _endCall() async {
    Provider.of<ProviderCall>(context, listen: false).incomingCall = null;
    Call reqCall = new Call();
    await Provider.of<ProviderCall>(context, listen: false).endCall(reqCall);
    Navigator.pop(context);
  }

  @override
  void dispose() {
    // clear users
    _users.clear();
    // destroy sdk
    AgoraRtcEngine.leaveChannel();
    AgoraRtcEngine.destroy();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.black,
      body: Center(
        child: Stack(
          children: <Widget>[
            _viewRows(),
            _panel(),
            _toolbar(),
          ],
        ),
      ),
    );
  }
}

Call Pickup Screen

onPressed: () async =>
    await cameraAndMicrophonePermissionsGranted()
        ? Navigator.push(
            context,
            MaterialPageRoute(
              builder: (context) => CallScreen(call: call),
            ),
          )
        : {},

static Future<bool> cameraAndMicrophonePermissionsGranted() async {
    PermissionStatus cameraPermissionStatus = await _getCameraPermission();
    PermissionStatus microphonePermissionStatus =
    await _getMicrophonePermission();

    if (cameraPermissionStatus == PermissionStatus.granted &&
        microphonePermissionStatus == PermissionStatus.granted) {
      return true;
    } else {
      _handleInvalidPermissions(
          cameraPermissionStatus, microphonePermissionStatus);
      return false;
    }
}

static Future<PermissionStatus> _getCameraPermission() async {
    var permission = await Permission.camera.status;
    if (permission != PermissionStatus.granted) {
      return (await Permission.camera.request());
    }
    return permission;
}

static Future<PermissionStatus> _getMicrophonePermission() async {
  var permission = await Permission.microphone.status;
  if (permission != PermissionStatus.granted) {
    return (await Permission.microphone.request());
  }
  return permission;
}

Only difference from flutter Quickstart agora demo is I am getting this warning while building apk

https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Note: /Users/profile/flutter/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-1.0.10/android/src/main/java/io/agora/agorartcengine/AgoraRtcEnginePlugin.java uses unchecked or unsafe operations.

I have thoroughly researched and tried every possible solution I can find but cannot get rid of this issue. This is the reason I have pasted code of all related files as I can not make any difference from demo app and still I am unable to get rid of this error. Kindly help me out.

When I accept a call on release build logs are as follows:

2020-04-23 06:21:29.356 1626-1847/? E/SyncManager: Bind attempt failed - target: ComponentInfo{com.amazon.venezia/com.amazon.venezia.common.scheduler.HollywoodSyncAdapter$HollywoodSyncService}2020-04-23 06:21:29.384 1626-1847/? E/SyncManager: Bind attempt failed - target: ComponentInfo{com.amazon.venezia/com.amazon.mas.client.serviceconfig.ServiceConfigSyncAdapter$SyncAdapterService}2020-04-23 06:21:29.689 1153-1153/? E/FlutterFcmService: Fatal: failed to find callback2020-04-23 06:21:37.708 1153-14748/? E/libc: Access denied finding property "net.dns1"2020-04-23 06:21:37.708 1153-14748/? E/libc: Access denied finding property "net.dns2"2020-04-23 06:21:37.708 1153-14748/? E/libc: Access denied finding property "net.dns3"2020-04-23 06:21:37.708 1153-14748/? E/libc: Access denied finding property "net.dns4"2020-04-23 06:21:37.767 684-754/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only2020-04-23 06:21:37.787 1153-1153/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.791 1153-1153/? E/libc: Access denied finding property "net.dns1"2020-04-23 06:21:37.791 1153-1153/? E/libc: Access denied finding property "net.dns2"2020-04-23 06:21:37.791 1153-1153/? E/libc: Access denied finding property "net.dns3"2020-04-23 06:21:37.791 1153-1153/? E/libc: Access denied finding property "net.dns4"2020-04-23 06:21:37.817 714-714/? E/HWComposer: getHdrCapabilities failed for display -1: Invalid display2020-04-23 06:21:37.820 714-714/? E/HWComposer: getSupportedPerFrameMetadata failed for display -1: Invalid display2020-04-23 06:21:37.850 1153-14747/? E/RtcEngine: onEvent: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.put(java.lang.Object, java.lang.Object)' on a null object reference2020-04-23 06:21:37.874 1153-1153/? E/libc: Access denied finding property "net.dns1"2020-04-23 06:21:37.874 1153-1153/? E/libc: Access denied finding property "net.dns2"2020-04-23 06:21:37.874 1153-1153/? E/libc: Access denied finding property "net.dns3"2020-04-23 06:21:37.874 1153-1153/? E/libc: Access denied finding property "net.dns4"2020-04-23 06:21:37.880 1153-14757/? E/libc: Access denied finding property "persist.vendor.camera.privapp.list"2020-04-23 06:21:37.897 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.897 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.899 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.900 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.900 892-10937/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 1: No such file or directory (-2)2020-04-23 06:21:37.900 892-10937/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 2: No such file or directory (-2)2020-04-23 06:21:37.903 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.903 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.907 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.907 1153-11038/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:37.908 684-754/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only2020-04-23 06:21:37.910 660-20927/? E/libc: Access denied finding property "ro.camera.req.fmq.size"2020-04-23 06:21:37.911 660-20927/? E/libc: Access denied finding property "ro.camera.res.fmq.size"2020-04-23 06:21:37.919 660-660/? E/CHIUSECASE: [CONFIG ] chxusecaseutils.cpp:668 GetMatchingUsecase() Default usecase selected2020-04-23 06:21:37.919 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2113 InitializeOverrideSession() Session_parameters FPS range 8:30, BatchSize: 1 FPS: 30 SkipPattern: 1, cameraId = 1 selected use case = 12020-04-23 06:21:37.919 660-660/? E/CHIUSECASE: [ERROR  ] chxadvancedcamerausecase.cpp:4231 Initialize() [lijun.feature]operationmode = 02020-04-23 06:21:37.919 660-660/? E/CHIUSECASE: [ERROR  ] chxadvancedcamerausecase.cpp:4283 Initialize() stream = 0x777a84eac8 streamType = 0 streamFormat = 35 streamWidth = 640 streamHeight = 4802020-04-23 06:21:37.919 660-660/? E/CHIUSECASE: [CONFIG ] chxpipeline.cpp:176 CreateDescriptor() Pipeline[Preview] : numInputs=0, numOutputs=12020-04-23 06:21:37.920 660-660/? E/CamX: [ERROR][PPROC  ] camxifenode.cpp:978 Create() Unhandled node property Id 12020-04-23 06:21:37.922 660-660/? E/CHIUSECASE: [CONFIG ] chxsensorselectmode.cpp:676 FindBestSensorMode() Selected Usecase: 7, SelectedMode W=2112, H=1568, FPS:30, NumBatchedFrames:1, modeIndex:12020-04-23 06:21:37.923 660-660/? E/CamX: [ERROR][PPROC  ] camxifenode.cpp:978 Create() Unhandled node property Id 12020-04-23 06:21:37.941 660-660/? E/CamX: [ERROR][ISP    ] camxifenode.cpp:8086 FinalizeBufferProperties()  ERROR pInputPortRequirement->optimalHeightis 02020-04-23 06:21:37.941 660-660/? E/CamX: [ERROR][ISP    ] camxifenode.cpp:8097 FinalizeBufferProperties()  ERROR perOutputPortOptimalHeight is 02020-04-23 06:21:37.941 660-660/? E/CamX: [ERROR][CORE   ] camxnode.cpp:3365 RemoveOutputDeviceIndices() Node::Preview_IFE0 No device indice found for removal2020-04-23 06:21:37.942 660-660/? E/CamX: [ERROR][SENSOR ] camxpdafdata.cpp:68 PDAFInit() PDAF name:ov13855_front_pdaf2020-04-23 06:21:37.942 660-660/? E/CamX: [ERROR][STATS_AF] pdlib_sparse_wrapper.cpp:50 init_sensor_info() init_sensor_info: pdaf init failed due to invalid crop region input2020-04-23 06:21:37.942 660-660/? E/CamX: [ERROR][STATS_AF] sparse_horizontal_flow.cpp:59 Init() set init info error2020-04-23 06:21:37.942 660-660/? E/CamX: [ERROR][SENSOR ] camxpdafdata.cpp:394 PDAFInit() PDAF Error: PD Library Initialization failed2020-04-23 06:21:37.949 660-660/? E/CamX: [ERROR][STATS_AEC] caeccoredatamanager.cpp:971: InitStatsConfig hist color channel not mapped: 8, forcing to Y 62020-04-23 06:21:37.949 660-660/? E/CamX: [ERROR][NONE:    ] camxstatsroiprocessor.cpp:424: SetCropWindow AECROI: invalid crop window (0.000000, 0.000000, 0.000000, 0.000000)2020-04-23 06:21:37.949 660-660/? E/CamX: [ERROR][STATS_AEC] caeccore.cpp:401: queryMetaData Query under init mode is not allowed.2020-04-23 06:21:38.071 660-660/? E/libc: Access denied finding property "persist.camera.facepp.fdenable"2020-04-23 06:21:38.078 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2168 InitializeOverrideSession() Logical cam Id = 1 usecase addr = 0x7783e000002020-04-23 06:21:38.078 660-660/? E/CHIUSECASE: [ERROR  ] chxextensionmodule.cpp:2198 InitializeOverrideSession() xieyue clientName=com.video.live, camera id=12020-04-23 06:21:38.078 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2201 InitializeOverrideSession() xieyue set 02020-04-23 06:21:38.084 660-660/? E/CamX: [ERROR][HAL    ] camxhaldevice.cpp:1297 DumpFrameworkRequests() +----------------------------------------------+2020-04-23 06:21:38.085 660-20927/? E/CHIUSECASE: [ERROR  ] chxextensionmodule.cpp:2732 HandleProcessRequestErrorAllPCRs() Sending Request error for frame 0 2020-04-23 06:21:38.136 660-20927/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:886 ExtendClose() xieyue reset 02020-04-23 06:21:38.139 660-20927/? E/CamX: [ERROR][HAL    ] camxhaldevice.cpp:1297 DumpFrameworkRequests() +----------------------------------------------+2020-04-23 06:21:38.139 660-20927/? E/CamX: [ERROR][HAL    ] camxhaldevice.cpp:1317 DumpFrameworkRequests() +   Error for Framework Request: 0, Num Output Buffers: 0, Partial Request: 2, Notify Error Sent: TRUE, Notify Shutter: FALSE2020-04-23 06:21:38.147 660-20927/? E/CamX: [ERROR][STATS_AF] sparse_horizontal_flow.cpp:175 GetAdaptiveData() null pointer2020-04-23 06:21:38.147 660-20927/? E/CamX: [ERROR][STATS_AF] sparse_horizontal_flow.cpp:149 DeInit() null pointer2020-04-23 06:21:38.342 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.342 892-11956/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 1: No such file or directory (-2)2020-04-23 06:21:38.342 892-11956/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 2: No such file or directory (-2)2020-04-23 06:21:38.343 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.343 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.343 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.343 660-20927/? E/CamX: [ERROR][SENSOR ] camxsensornode.cpp:241 ReleaseOneSubDevice() CameraID=1 Subdevice=0 refCount already 0!2020-04-23 06:21:38.343 660-20927/? E/CamX: [ERROR][SENSOR ] camxsensornode.cpp:241 ReleaseOneSubDevice() CameraID=1 Subdevice=1 refCount already 0!2020-04-23 06:21:38.343 660-20927/? E/CamX: [ERROR][SENSOR ] camxsensornode.cpp:241 ReleaseOneSubDevice() CameraID=1 Subdevice=2 refCount already 0!2020-04-23 06:21:38.343 660-20927/? E/CamX: [ERROR][SENSOR ] camxsensornode.cpp:241 ReleaseOneSubDevice() CameraID=1 Subdevice=3 refCount already 0!2020-04-23 06:21:38.343 660-20927/? E/CamX: [ERROR][SENSOR ] camxsensornode.cpp:241 ReleaseOneSubDevice() CameraID=1 Subdevice=4 refCount already 0!2020-04-23 06:21:38.344 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.344 1153-1166/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.346 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.346 1153-1433/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.384 1153-14757/? E/libc: Access denied finding property "persist.vendor.camera.privapp.list"2020-04-23 06:21:38.388 1153-1433/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.389 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.390 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.390 1153-1433/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.390 892-11956/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 1: No such file or directory (-2)2020-04-23 06:21:38.390 892-11956/? E/CameraService: onTorchStatusChangedLocked: cannot get torch status of camera 2: No such file or directory (-2)2020-04-23 06:21:38.390 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.390 1153-1433/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.391 29637-30546/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.391 1153-1433/? E/libc: Access denied finding property "vendor.camera.aux.packagelist"2020-04-23 06:21:38.392 660-660/? E/libc: Access denied finding property "ro.camera.req.fmq.size"2020-04-23 06:21:38.392 660-660/? E/libc: Access denied finding property "ro.camera.res.fmq.size"2020-04-23 06:21:38.399 660-660/? E/CHIUSECASE: [CONFIG ] chxusecaseutils.cpp:668 GetMatchingUsecase() Default usecase selected2020-04-23 06:21:38.399 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2113 InitializeOverrideSession() Session_parameters FPS range 8:30, BatchSize: 1 FPS: 30 SkipPattern: 1, cameraId = 1 selected use case = 12020-04-23 06:21:38.399 660-660/? E/CHIUSECASE: [ERROR  ] chxadvancedcamerausecase.cpp:4231 Initialize() [lijun.feature]operationmode = 02020-04-23 06:21:38.399 660-660/? E/CHIUSECASE: [ERROR  ] chxadvancedcamerausecase.cpp:4283 Initialize() stream = 0x7784653028 streamType = 0 streamFormat = 35 streamWidth = 640 streamHeight = 4802020-04-23 06:21:38.400 660-660/? E/CHIUSECASE: [CONFIG ] chxpipeline.cpp:176 CreateDescriptor() Pipeline[Preview] : numInputs=0, numOutputs=12020-04-23 06:21:38.400 660-660/? E/CamX: [ERROR][PPROC  ] camxifenode.cpp:978 Create() Unhandled node property Id 12020-04-23 06:21:38.401 660-660/? E/CHIUSECASE: [CONFIG ] chxsensorselectmode.cpp:676 FindBestSensorMode() Selected Usecase: 7, SelectedMode W=2112, H=1568, FPS:30, NumBatchedFrames:1, modeIndex:12020-04-23 06:21:38.402 660-660/? E/CamX: [ERROR][PPROC  ] camxifenode.cpp:978 Create() Unhandled node property Id 12020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][ISP    ] camxifenode.cpp:8086 FinalizeBufferProperties()  ERROR pInputPortRequirement->optimalHeightis 02020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][ISP    ] camxifenode.cpp:8097 FinalizeBufferProperties()  ERROR perOutputPortOptimalHeight is 02020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][CORE   ] camxnode.cpp:3365 RemoveOutputDeviceIndices() Node::Preview_IFE0 No device indice found for removal2020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][SENSOR ] camxpdafdata.cpp:68 PDAFInit() PDAF name:ov13855_front_pdaf2020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][STATS_AF] pdlib_sparse_wrapper.cpp:50 init_sensor_info() init_sensor_info: pdaf init failed due to invalid crop region input2020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][STATS_AF] sparse_horizontal_flow.cpp:59 Init() set init info error2020-04-23 06:21:38.420 660-660/? E/CamX: [ERROR][SENSOR ] camxpdafdata.cpp:394 PDAFInit() PDAF Error: PD Library Initialization failed2020-04-23 06:21:38.431 660-660/? E/CamX: [ERROR][STATS_AEC] caeccoredatamanager.cpp:971: InitStatsConfig hist color channel not mapped: 8, forcing to Y 62020-04-23 06:21:38.431 660-660/? E/CamX: [ERROR][NONE:    ] camxstatsroiprocessor.cpp:424: SetCropWindow AECROI: invalid crop window (0.000000, 0.000000, 0.000000, 0.000000)2020-04-23 06:21:38.432 660-660/? E/CamX: [ERROR][STATS_AEC] caeccore.cpp:401: queryMetaData Query under init mode is not allowed.2020-04-23 06:21:38.511 660-660/? E/libc: Access denied finding property "persist.camera.facepp.fdenable"2020-04-23 06:21:38.518 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2168 InitializeOverrideSession() Logical cam Id = 1 usecase addr = 0x7783e000002020-04-23 06:21:38.518 660-660/? E/CHIUSECASE: [ERROR  ] chxextensionmodule.cpp:2198 InitializeOverrideSession() xieyue clientName=com.video.live, camera id=12020-04-23 06:21:38.518 660-660/? E/CHIUSECASE: [CONFIG ] chxextensionmodule.cpp:2201 InitializeOverrideSession() xieyue set 02020-04-23 06:21:38.546 660-1589/? E/CamX: [ERROR][STATS_AEC] caeccoredatamanager.cpp:971: InitStatsConfig hist color channel not mapped: 8, forcing to Y 62020-04-23 06:21:38.552 660-1589/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.559 660-1588/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.563 660-1588/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.567 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.620 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:619 |    0)  14748; [ch0] login strategy=22020-04-23 06:21:38.716 660-1584/? E/libc: Access denied finding property "persist.camera.facepp.frontsetting"2020-04-23 06:21:38.721 660-1584/? E/CamX: [ERROR][STATS_AFD] afd_process.cpp:1626: afd_process_algo_run Either Null Stats Ptr or rowSumTime<=0: rowSumstats=0x7782dc4560, bg_stats=0x7782dc4578, rowSumTime=0.0000002020-04-23 06:21:38.724 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.763 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.766 1153-14747/? E/RtcEngine: onEvent: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.util.HashMap.put(java.lang.Object, java.lang.Object)' on a null object reference2020-04-23 06:21:38.767 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:767 |    0)  14748; onPeerAudioMuteStatus: uid 330315180 already unmuted2020-04-23 06:21:38.810 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:810 |    0)  14748; API call failed to stop video preview due to not in idle mode2020-04-23 06:21:38.816 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.837 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:837 |    0)  14756; [AudioDevice Java] AcousticEchoCanceler.getEnabled: false2020-04-23 06:21:38.845 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:845 |    8)  14756; [AudioDevice Java] Recording start time 228045687591572020-04-23 06:21:38.846 660-1585/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.849 656-14800/? E/msm8974_platform: platform_check_backends_match: Invalid snd_device = 2020-04-23 06:21:38.852 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:852 |    0)   1153; [AudioRoute] default routing: Speakerphone bluetooth false, current routing: Speakerphone, actual system routing: Speakerphone2020-04-23 06:21:38.878 656-14800/? E/ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -192020-04-23 06:21:38.878 656-14800/? E/ACDB-LOADER: Error: ACDB AFE returned = -192020-04-23 06:21:38.879 656-14800/? E/ACDB-LOADER: Error: ACDB_CMD_GET_AFE_INSTANCE_COMMON_TABLE_SIZE Returned = -192020-04-23 06:21:38.879 656-14800/? E/ACDB-LOADER: Error: ACDB AFE returned = -192020-04-23 06:21:38.879 656-14800/? E/audio_hw_utils: audio_extn_utils_update_stream_app_type_cfg_for_usecase: app type cfg not supported for usecase type (3)2020-04-23 06:21:38.886 660-1584/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.930 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:38.937 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:937 |    0)  14801; AgoraVideoOutput::Init unable to initialize renderer2020-04-23 06:21:38.937 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:38:937 |    0)  14801; doStartRemoteRender: failed to initialize remote render, uid=330315180, view=0x02020-04-23 06:21:38.979 660-1585/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:39.031 660-1584/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:39.045 656-11155/? E/volume_listener: check_and_set_gain_dep_cal: Failed to set gain dep cal level2020-04-23 06:21:39.045 712-14797/? E/AudioFlinger: Error when setting output stream volume: -382020-04-23 06:21:39.048 1153-14746/? E/AGORA_SDK: ERROR   ( 6:21:39: 48 |    4)  14754; [AudioDevice Java] caculated the first render TS = 202 pos = 20ms delay 2352020-04-23 06:21:39.084 660-1584/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:39.130 660-1585/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.2020-04-23 06:21:39.181 660-1586/? E/CHIUSECASE: [ERROR  ] chxusecase.cpp:1013 ReturnFrameworkResult() CTS: delete_camera_metadata_entry ANDROID_CONTROL_AF_REGIONS for FrontSensor.

LichKing-2234 commented 4 years ago

have your try our demo?

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 Yes I have tried flutter demo. In same mobile release build of your demo is working fine without white screen. This makes me sure it is not device specific or internet blockage issue.

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 If I make a call from release build it will show front camera working fine but as soon as receiver pics the call which means joins the channel the screen on release Android build goes white. But in case of debug build it works fine. If I make call from another device and join channel from Android release build device it is white screen from the very first frame. I am unable to fix this error though I tried to keep each and every line same as demo project even the gradle version.

LichKing-2234 commented 4 years ago

@sourab-sasan-sharma I found this. why run _leaveChannel(); when received onUserOffline?

AgoraRtcEngine.onUserOffline = (int uid, int reason) {
      // if call was picked
      setState(() {
        final info = 'userOffline: $uid';
        _infoStrings.add(info);
        _users.remove(uid);
        _leaveChannel();
      });
    };
sourab-sasan-sharma commented 4 years ago

@LichKing-2234 As this is one to one video call app , onUserOffline "_leaveChannel();" is helping to disconnect call at other user end. I tried to run release build with all lines related to leaveChannel and endCall commented but still no change at all. Same result as soon as second user has joined in release build it become white screen.

I have tested 2 times just now again, in debug build it is working absolutely fine. Please be assured leaveChannel is never called in this testing at both end in any event.

Debug Build

But as soon as I create a release build it goes white again.

Release Build White Screen

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 I have created another demo project and same issue exists. Working fine for debug build but in case of release build white screen appears. I have uploaded Demo project so that you can see yourself how just changing buildType is causing an issue.

https://github.com/sourab-sasan-sharma/AgoraTestDemo.git

Please download and test the demo project and you will find that my monster is real. As I am using FCM to send channelId to another device, I have integrated that step too in this demo project. On launch screen please press "Set FCM Caller 1" on first device and "Set FCM Caller 2" on second device. After that from next screen please press "Call Now" from either device.

I really hope this demo project can help me to get rid of this issue. Looking forward to your testing feedback and solution for this problem.

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 Any update ? I am totally dependent on your help regarding this issue.

LichKing-2234 commented 4 years ago

@sourab-sasan-sharma Sorry for the later reply, I have run your demo, but not work when I click the Call Now button, maybe my network can not connect to firebase?

LichKing-2234 commented 4 years ago

I modify the code to test it, it worked for me. image

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 Thanks for getting back to me. I had implemented some changes for my project. I have revert back server changes as per demo requirement and now you should be able to test the demo without network error call.

Looking forward to solution for release build white screen on join channel.

LichKing-2234 commented 4 years ago

replace the Expanded to Container, then it worked. it may be a bug of flutter. Expanded can't contain Expanded in release mode? image

sourab-sasan-sharma commented 4 years ago

@LichKing-2234 Many thanks for solutions. As it was happening as soon as other user join channel , I got sure it must be agora sdk issue. But it turns out it was never your team issue. Many Many thanks for your support and solution.