android WebView webRTC error CheckMediaAccessPermission: Not supported - android

I have a peerJS video call app running on android WebView. I'm getting the following error from logcat
E/chromium: [ERROR:web_contents_delegate.cc(228)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
I have granted the permissions using this code:
webView.webChromeClient = object : WebChromeClient() {
override fun onPermissionRequest(request: PermissionRequest?) {
request?.grant(request.resources)
}
}
Everything works fine and I'm able to stream the video. But, How can I avoid this error? Should I be worried about this?

I had the same error, in my application audio recording didn't work.
Here is my contents for my AndroidManifest.xml
<manifest xlmns:android...>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-feature android:name="android.hardware.microphone"/>
<uses-permission android:name="android.permission.AUDIO_CAPTURE" />
I solved this error by adding <uses-permission android:name="android.permission.MICROPHONE" />

Related

Android permissions ask something I don't want

I'm making a React-Native app and in the AndroidManifest.xml file, I ask some things :
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" android:maxSdkVersion="29"/>
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
As you can see, I never ask my app to access to the contacts.
However, when I build my app, she ask me the permission to access to my contacts.
Have you an idea ? Thanks !
You can check which dependency has added the permission by looking at the
android/app/build/outputs/logs/manifest-merger-debug-report.txt log.

Can't access to camera through react-native-webview

I am using react-native-webview version 4.0.2 . So I have a webview that contains an add button that allows us to take picture with the camera but when clicking at that button nothing is shown and no camera permission shown. This is on android side but working very well on ios (i can see permission and access to camera ).
In my AndroidManifest.xml I do have :
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
So please do you have any suggestion ?
Try using:
<uses-sdk
android:minSdkVersion="23"
android:targetSdkVersion="__APILEVEL__" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO"
android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"
android:maxSdkVersion="18" />
1st step:
use this in AndroidManifest.xml file
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
2nd step:
Grant multiple permission in App.js file
const granted = await PermissionsAndroid.requestMultiple([
PermissionsAndroid.PERMISSIONS.CAMERA,
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
]);
3rd step:
use these properties inside webview
geolocationEnabled={true}
mediaPlaybackRequiresUserAction={false}
javaScriptEnabled={true}
you need to add this too inside webview mediaPlaybackRequiresUserAction={false}
If you use Expo, in my case, temporarily, I solve it by doing this. In the website's code, not the react-native code, change
navigator.mediaDevices.getUserMedia({video : true, audio:true})
to
navigator.mediaDevices.getUserMedia({video : true})
In the long term, if you use Expo, you should switch to React Native cli

App not showing on Google Play despite it's compatible

I have a serious problem concerning the compatibility of my app with some devices.
At the moment these are my configurations and permissions:
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<supports-screens android:anyDensity="true" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
This would in my opinion mean that my application is compatible with every smartphone (not tablet) with Android 4.0.x or higher. Is that correct?
Because I recognized that it is not compatible with Samsung Galaxy S II with 4.1.1 which I simulated with Genmyotion. Also our customer described this beviour on a real device. Does anyone of you know why this problem could occur?
I think I have found the problem by myself (see android market says no device compatible?)
I have included permission
<uses-permission android:name="android.permission.CAMERA"/>
which by default includes auto focus feature. So I have to add the following in my manifest to disable it:
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
Thanks to chrish

Can't connect Android to the web, why this code doesn't work?

I don't know why I can't connect anywhere with this code: (the ping returns 2)
public class PhoneGapProjActivity extends DroidGap {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Runtime runtime = Runtime.getRuntime();
Process proc;
proc = runtime.exec("ping www.google.com -c 1");
proc.waitFor();
Log.d("someTag", "exitValue(): " + proc.exitValue());
...
}
the permissions are as follows:
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
Define your permissions under manifest (as direct child). For example:
<manifest>
...
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
As Waqas said, the permission must be declared outside the tag.
Besides that, there is a weird characteristic in the implementation of ping in android that may cause you trouble. The options must be defined before the target host, so ping www.stackoverflow.com -c 1 will not be accepted, but ping -c 1 www.stackoverflow.com will.
I can't assure you that's the behaviour with all android phones, but that's the behaviour i get in the Galaxy S2 with stock build and in the Nexus S running cyanogen.
just add the following permission in your manifest file
<uses-permission android:name="android.permission.INTERNET" />

Getting unavailable feature android.hardware.sdcard; failing! error when sdcard is present in Android

I am getting the following error when I am trying to install my app on my HTC device.
Package com.org.activities requires unavailable feature
android.hardware.sdcard; failing!
However, I do have my SD card in my device.
Here is the code I have written in my manifest file:
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.FLASHLIGHT"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.sdcard" android:required="true"/>
<uses-feature android:name="android.hardware.camera" android:required="true"/>
What's wrong with it? I need to check for these features as I am using an SD card and the camera for my app.
This hardware feature does not seem to exist. I can't find it in the reference?
http://developer.android.com/guide/topics/manifest/uses-feature-element.html#hw-features
How did you arrive at this feature name?

Categories

Resources