React Native camera Tap to foucs not working in android - react-native

Tap-to-focus with react-native-camera is not working on Android.
Already tried with defaultOnFocusComponent={ true } and add this to AndroidManifest:
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
But still i am unable to tap and set focus on React Native Camera

Related

React Native Android TV - DPad Functionality missing

I have published a react native application to google play store for Android Mobile and android tv.
App successfully published for Android Mobile but rejected for Android Tv.
For tv, I have received notification for:
Missing DPad functionality
Your app requires user interaction for menus or app navigation. Please make sure that all menus and app navigation are fully functional using a DPad. Please refer to our DPAD Control and Hardware Declaration documentation.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rsdtech">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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.ACCESS_WIFI_STATE" />
<uses-feature android:name="android.software.leanback"
android:required="false" />
<uses-feature android:name="android.hardware.touchscreen"
android:required="false" />
<application
android:name=".MainApplication"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:banner="#drawable/tv_banner"
android:allowBackup="false"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true"
>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:launchMode="singleTask"
android:windowSoftInputMode="adjustPan"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
How to add DPad functionality in my project. App have functionality focus and navigation on android tv but Even then got rejected from google play console.
If you need any more info add , just let me know.
You need to use the leanbackLauncher.
I've gotten it working but am away from computer so I'll update this once I can check out how I did it, but I'm 99% sure if you Google leanbackLauncher it will lead you in the right direction

APK Launching, "Keep Stopping" Message and logcat error..? How to fix?

I apk launching after logcat show this error.
The following permissions have to be defined in the manifest.xml file when using wifi state.
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

react-native: cannot access Android permissions with release mode

I used React Native 0.59.9 with expo-permissions to get location, notification and camera rolls permissions from mobiles for my app. Everything is OK with iOS and Android in debug mode. With Android release APK, I cannot get those permissions even I enabled manually in the app setting.
I tried to migrate code from expo to pure react-native
gradle file
compileSdkVersion 28
defaultConfig {
applicationId 'com.xxx.android'
targetSdkVersion 28
versionCode 18
versionName '2.40.00'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
manifestPlaceholders = [
'appAuthRedirectScheme': 'com.xxxx'
]
}
Android Manifest permissions
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I always get nerver_ask_again result on Android release APK, even it's a fresh app. Everything is ok on debug mode.
copy your all
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
into ###{projectfolder}/android/app/main/AndroidManifest.xml###

Start Perview failed camera in react native

I have a component that it scans a QR code.this is my code:
import QRCodeScanner from 'react-native-qrcode-scanner';
.
.
.
<QRCodeScanner
cameraType={'front'}
onRead={this.onSuccess.bind(this)} />
.
.
.
onSuccess(e) {
console.warn(e.data);
}
this is my plist and androidmanifest.xml:
<key>NSCameraUsageDescription</key>
<string>Your message to user when the camera is accessed for the first
time</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Your message to user when the photo library is accessed for the
first time</string>
<key>NSMicrophoneUsageDescription</key>
<string>Your message to user when the microsphone is accessed for the
first time</string>
androidmanifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.CAMERA" /> <uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26" />
</manifest>
but I receive this error: Start Preview failed camera
How can I resolve that?
Thanks, advance

Duplicate Permission AndroidManifest.xml with React Native

Is it ok to have duplicate permissions in AndroidManifest.xml file?
I am trying to add in react-native-webrtc into my react-native project which requires me to add in some permissions. The initial AndroidManifest.xml file already have a list of permissions which some will be duplicated if I add in the permissions required by react-native-webrtc. Since, im on this question, does the same goes for ios?
REQUIRED TO ADD IN BY REACT-NATIVE-WEBRTC
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
ORIGINAL
<!-- These are required permissions to make the app run -->
<uses-permission android:name="com.bulbtech.hendrysocket.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- ADD PERMISSIONS HERE -->
<!-- BEGIN OPTIONAL PERMISSIONS -->
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
No, you can not duplicate permissions in AndroidManifest.xml file and if you duplicate the permission then your code gets crashed and some goes for ios