AgoraIO-Community / Agora-Flutter-Quickstart

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

android.system.ErrnoException: open failed: EACCES (Permission denied) #210

Closed raffvirdo closed 3 years ago

raffvirdo commented 3 years ago

I'm getting the following errors when running on an Android emulator and physical device (Note 8). The functionality is fine and there doesn't seem to be any problems with use, but the error messages are long and continuous:

W/GENP.0 (12467): type=1400 audit(0.0:49299): avc: denied { read } for name="temp" dev="sysfs" ino=16830 scontext=u:r:untrusted_app:[] tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app= [APPNAME] E/libc (12467): Access denied finding property "net.dns1" E/libc (12467): Access denied finding property "net.dns2" E/libc (12467): Access denied finding property "net.dns3" E/libc (12467): Access denied finding property "net.dns4" W/GENP.0 (12467): type=1400 audit(0.0:49300): avc: denied { read } for name="temp" dev="sysfs" ino=16830 scontext=u:r:untrusted_app:[] tcontext=u:object_r:sysfs:s0 tclass=file permissive=0 app=[APPNAME] I/agora_vrp(12467): Frames out=31. out Fps=15, Total out=31, stream=0, out interv=0, 0, 2, 1, 27, out render time interv=0, 0, 2, 1, 27 E/agora_vrp(12467): Frames replaced by swap=0, stream=0 I/agora_vrp(12467): stuck_watch: fps=16, id=0 I/agora_vrp(12467): stuck_watch: total=31, 0~15=3%, 15~30=0%, 30~40=3%, 40~60=3%, 60~80=87%, 80~110=3%, 110~150=0%, 150~200=0%, 200+=0%, id=0 I/agora_vrp(12467): stuck_watch: interval_distribution=216186102692708352, sd:1479, id:0 I/agora_vrp(12467): Frames rendered=32. Render Fps=16, Total rendered=32, stream=0, draw cost=32, 0, 0, 0, 0, 0, render inter=1, 0, 1, 1, 27, 1, 0, 0, 0 W/System.err(12467): java.io.FileNotFoundException: /sys/class/thermal/thermal_zone0/temp: open failed: EACCES (Permission denied) W/System.err(12467): at libcore.io.IoBridge.open(IoBridge.java:492) W/System.err(12467): at java.io.FileInputStream.<init>(FileInputStream.java:160) W/System.err(12467): at io.agora.rtc.gdp.GDPAndroid.readOneLine(GDPAndroid.java:383) W/System.err(12467): at io.agora.rtc.gdp.GDPAndroid.getCpuTemperature(GDPAndroid.java:362) W/System.err(12467): Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) W/System.err(12467): at libcore.io.Linux.open(Native Method) W/System.err(12467): at libcore.io.ForwardingOs.open(ForwardingOs.java:166) W/System.err(12467): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254) W/System.err(12467): at libcore.io.ForwardingOs.open(ForwardingOs.java:166) W/System.err(12467): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542) W/System.err(12467): at libcore.io.IoBridge.open(IoBridge.java:478) W/System.err(12467): ... 3 more W/System.err(12467): java.io.FileNotFoundException: /sys/devices/virtual/thermal/thermal_zone0/temp: open failed: EACCES (Permission denied) W/System.err(12467): at libcore.io.IoBridge.open(IoBridge.java:492) W/System.err(12467): at java.io.FileInputStream.<init>(FileInputStream.java:160) W/System.err(12467): at io.agora.rtc.gdp.GDPAndroid.readOneLine(GDPAndroid.java:383) W/System.err(12467): at io.agora.rtc.gdp.GDPAndroid.getCpuTemperature(GDPAndroid.java:362) W/System.err(12467): Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied) W/System.err(12467): at libcore.io.Linux.open(Native Method) W/System.err(12467): at libcore.io.ForwardingOs.open(ForwardingOs.java:166) W/System.err(12467): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254) W/System.err(12467): at libcore.io.ForwardingOs.open(ForwardingOs.java:166) W/System.err(12467): at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7542) W/System.err(12467): at libcore.io.IoBridge.open(IoBridge.java:478) W/System.err(12467): ... 3 more

This keeps repeating for as long as the video chat is open.

plutoless commented 3 years ago

have you granted file system access to your app?

raffvirdo commented 3 years ago

have you granted file system access to your app?

Thanks for the fast response!

I'm not exactly sure how to do that or how to confirm. These are the permissions I have in my AndroidManifest:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <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" />

Do I need to add a permission here?

raffvirdo commented 3 years ago

Update: I've added the "READ_EXTERNAL_STORAGE" permission to my AndroidManifest but the error is still showing while in a video call.

LichKing-2234 commented 3 years ago

@oplattethunder this is a bug from our native SDK, but you can ignore it because it just throws logs to the logcat.

LichKing-2234 commented 3 years ago

duplicate issue https://github.com/AgoraIO/Agora-Flutter-SDK/issues/243

bharatbl94 commented 3 years ago

First, check whether you have implemented scoped storage logic in-app. You can also use android:requestLegacyExternalStorage="true" But this legacyStoragePermission is limited to version 10. You need to implement scoped logic.

Also, check whether your targetSDKVersion value is 30 or greater or not, this is needed if you are using the app in Device android version 30 or more.