I'm trying to run my first React Native project for first time on my device (Android 4.2.2).
And I get:
unable to load script from assets index.android.bundle
Commands that I used:
cd (project directory)
react-native start
react-native run-android
I'm trying to run my first React Native project for first time on my device (Android 4.2.2).
And I get:
unable to load script from assets index.android.bundle
Commands that I used:
cd (project directory)
react-native start
react-native run-android
I cloned a React Native project and I try to run the commandyarn run android
or adb reverse tcp:8081 tcp:8081 & set NODE_ENV=development & react-native run-android --list-devices --verbose
But I keep getting the following error
error Failed to build the app.Error: Command failed with exit code 1: gradlew.bat app:installDebug -x lint -PreactNativeDevServerPort=8081 at makeError (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\execa\lib\error.js:60:11) at module.exports.sync (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\execa\index.js:194:17) at build (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\@react-native-community\cli-platform-android\build\commands\buildAndroid\index.js:68:22) at runOnSpecificDevice (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:221:33) at buildAndRun (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:164:14) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Command.handleAction (C:\Users\HUAWEI\WebstormProjects\Martines\application\client\node_modules\@react-native-community\cli\build\index.js:118:9)error Command failed with exit code 1.
My computer's OS is Windows 11, I've installed java SDK 22, added the env and path variables for both Java and Android.
I have no idea on what to do next. I already tryed that solution text
But I already have a settings file, that seems fine to me:
rootProject.name = 'LesMartines'apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)include ':app'includeBuild('../node_modules/@react-native/gradle-plugin')
Thanks in advance !
Am trying to setup react-native(with Android) in Windows 11 and followed all the steps mentioned in the documentationhttps://reactnative.dev/docs/environment-setup
But on running npm run android
, I get the following error
Downloading https://services.gradle.org/distributions/gradle-8.6-all.zipException in thread "main" javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:370) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:313) at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:308) at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1357).........
On running npx react-native doctor
, I get the following result
Common✓ Node.js - Required to execute JavaScript code✓ npm - Required to install NPM dependencies● Metro - Metro Bundler is not runningAndroid✓ Adb - Required to verify if the android device is attached correctly✓ JDK - Required to compile Java code✓ Android Studio - Required for building and installing your app on Android✓ ANDROID_HOME - Environment variable that points to your Android SDK installation✓ Gradlew - Build tool required for Android builds✓ Android SDK - Required for building and installing your app on Android
Tried going through the SO link, but I could not understand clearly from which link I should be downloading the certificate in my browser and add it to the truststore or why is it even required to be downloaded manually.
I tried troubleshooting by following the steps this link, but still the same error.
npm version: 10.5.2node version: 20.9.0react-native version: 0.74.0java version: java 17.0.1 2021-10-19 LTS
Can someone please help or guide me?
npm run android
should run and launch the project
I have a React Native Android application in which I am setting a cookie this way:
CookieManager.set('http://localhost:5000', { name: 'X-Auth', value: 'sdg1s6g1sd65f1a65s1fas6gs1d65a1s1hj51jtjgd6fgs', version: '1', expires: '2025-05-30T12:30:00.00-05:00', }) .then((done) => { console.log('CookieManager.set =>', done); })
The cookie seems to be created successfully as I enter the then block. Afterwards, I open my Android emulator device's Google Chrome and go to http://localhost:5000 where my web app is located.
Then I open Google Chrome on my MacBook and go to chrome://inspect/#devices from where I inspect the Emulator's Google Chrome. Afterwards I navigate to "Application" in the dev tools and then open the cookies where I can't really see the cookie that I have set.
Am I misunderstanding how cookies work? I imagine that since I'm setting the cookie for http://localhost:5000 which is my Web application's URL, the cookie would be available there.
When trying to deploy an app to the Play Store I get an error stating the project says it uses ads when the profile on Google says we don't. The app doesn't use ads and the com.google.android.gms.permission.AD_ID tag is not in the manifest before or after building the app. Any Ideas on how to fix this issue to release the app to the play store?
I have checked the manifest before and after the app is built and it doesn't include the stated flag. I have searched online but can't find how to resolve the issue. I have also tried to message Google however never got a reply
I have the following component:
export default class StoreComponent extends Component { render() { return (<View style={styles.container}><ScrollView contentContainerStyle={styles.scroll}><StoreCarouselComponent /><StoreDiscountComponent /><StoreDetailsComponent /></ScrollView></View> ); }}
with this style
import { StyleSheet, Dimensions, } from 'react-native';const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#ffffff', }, scroll: { flex: 1, flexDirection: 'row', justifyContent: 'center' }, image: { width: Dimensions.get('window').width, height: 350, }, box: { width: Dimensions.get('window').width - 30, position: 'absolute', shadowColor: '#000000', shadowOpacity: 0.34, shadowRadius: 5, shadowOffset: { width: 0, height: 10 }, elevation: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, borderBottomLeftRadius: 10, borderBottomRightRadius: 10, borderColor: 'lightgrey', backgroundColor: '#ffffff', padding: 10, marginTop: 410, }, boxDiscount: { width: Dimensions.get('window').width - 30, position: 'absolute', shadowColor: '#000000', shadowOpacity: 0.34, shadowRadius: 5, shadowOffset: { width: 0, height: 10 }, elevation: 10, borderTopLeftRadius: 10, borderTopRightRadius: 10, borderBottomLeftRadius: 10, borderBottomRightRadius: 10, borderColor: 'lightgrey', backgroundColor: '#253241', padding: 10, marginTop: 320, }, title: { fontSize: 30 }, distance: { fontSize: 20, color: '#767676' }, distanceElement: { fontSize: 20, color: '#44D9E6' }, address: { fontSize: 20, color: '#767676' }, category: { fontSize: 20, color: '#767676', }, categoryElement: { fontSize: 20, color: '#44D9E6', }, hr: { borderBottomColor: 'lightgrey', borderBottomWidth: 1, }, icons: { flex: 1, flexDirection: 'row', justifyContent: 'center', }});export default styles;
my scrollview works on ios but on android don't and I don't understand why
here a an image of the app and as you can see I need to scroll on android:
This is for a react native app being built in expo cloud.
In short I am trying to change the build.gradle minSdkVersion from 21 to 24 in expo cloud build. The long version is below.
Here is the issue I am trying to solve:
uses-sdk:minSdkVersion value (24) specified in the manifest file is ignored. It is overridden by the value declared in the DSL or the variant API, or 1 if not declared/present. Current value is (21).
The original error was:
uses-sdk:minSdkVersion 21 cannot be smaller than version 24 declared in library
After digging I found that the AndroidManifest file was setting the minSdkVersion to 21 but it needed to be 24. After many hours of trial and error I got this plugin to work:
const { withAndroidManifest } = require("@expo/config-plugins");function addMinSdkVersion(androidManifest) { const { manifest } = androidManifest; if (!manifest.$) { console.warn("addMinSdkVersion: Missing root attributes in manifest?"); return androidManifest; } manifest.$["xmlns:android"] = "http://schemas.android.com/apk/res/android"; manifest["uses-sdk"] = [{ $: {"android:minSdkVersion": "24", }, }]; return androidManifest;}module.exports = function withAndroidMainActivityAttributes(config) { return withAndroidManifest(config, (config) => { config.modResults = addMinSdkVersion(config.modResults); return config; });};
Now it seems that this value from the Android Manifest is being overwritten by the build.gradle setting. I have tried many many ways to fix this and non have worked. Here's my latest plugin attempt:
const { withProjectBuildGradle } = require("@expo/config-plugins");function modifyMinSdkVersion(buildGradle) { const { buildscript } = buildGradle; console.log(buildscript); buildscript.minSdkVersion = 24 console.log(buildGradle); return buildGradle;}module.exports = function withMinSdkVersion(config) { return withProjectBuildGradle(config, (config) => { config.modResults.contents = modifyMinSdkVersion(config.modResults.contents); return config; });};
This is executed here in the app.json file:
"plugins": ["./plugins/android-manifest.plugin.js","./plugins/android-gradle.plugin.js"]
I have also tried these settings in the app.json:
"android": {"minSdkVersion": 24,}"mods": {"android": {"manifest": {"usesSdk": {"minSdkVersion": 24 } } }}"expo-build-properties": {"android": {"minSdkVersion": 24, } }
Also tried this but .replace is not recognised as a function:
const { withProjectBuildGradle } = require("@expo/config-plugins");function modifyMinSdkVersion(buildGradle) { const modifiedBuildGradle = buildGradle.replace(/minSdkVersion\s+\d+/, 'minSdkVersion 24'); return modifiedBuildGradle;}module.exports = function withMinSdkVersion(config) { return withProjectBuildGradle(config, (config) => { config.modResults.contents = modifyMinSdkVersion(config.modResults.contents); return config; });};
If anyone has any information that may guide me to the solution I am all ears. Its worth noting that I could have changed the version of plugins to try and get them all compatible with sdk 21, however there were a few of them which would have taken a while to find the correct versions to use and get them working together. It would also have meant lots of testing, the app has been deploying and working fine in IOS.
Thanks :)
I'm working on a small app. When reaching a page using react-native-tab-view
, the below error occurs:
ERROR Invariant Violation: requireNativeComponent: "RNCViewPager" was not found in the UIManager.This error is located at: in RNCViewPager (at PagerView.tsx:207) in PagerViewInternal (at PagerView.tsx:233) in Unknown (at createAnimatedComponent.js:54) in Unknown (at PagerViewAdapter.tsx:143) in PagerViewAdapter (at TabView.tsx:84) in RCTView (at View.js:116) in View (at TabView.tsx:83)
I believe this error relates to react-native-pager-view
. However, I clearly have that installed in my package.json.
{"name": "*****","version": "0.2","scripts": {"start": "expo start --dev-client","android": "expo run:android","ios": "expo run:ios","web": "expo start --web","devtools": "react-devtools","test": "jest --detectOpenHandles","lint": "eslint ." },"dependencies": {"@babel/plugin-transform-object-rest-spread": "^7.24.5","@expo/config-plugins": "~7.8.0","@expo/prebuild-config": "~6.7.0","@firebase/app": "^0.9.16","@firebase/firestore": "^4.1.1","@gorhom/bottom-sheet": "^4.6.1","@react-native-async-storage/async-storage": "1.21.0","@react-navigation/native": "^6.1.9","@react-navigation/stack": "^6.3.17","@redux-devtools/extension": "^3.3.0","@redux-devtools/instrument": "^2.2.0","@redux-devtools/serialize": "^0.4.2","@reduxjs/toolkit": "^1.9.5","@sentry/cli": "^2.31.1","@sentry/react-native": "~5.20.0","date-fns": "^2.30.0","expo": "~50.0.17","expo-build-properties": "~0.11.1","expo-constants": "~15.4.6","expo-dev-client": "~3.3.11","expo-splash-screen": "~0.26.5","firebase": "^10.2.0","i18next": "^23.6.0","i18next-react-native-async-storage": "^1.0.4","normalizr": "^3.6.2","react": "18.2.0","react-devtools": "^4.28.0","react-i18next": "^13.3.1","react-native": "0.73.6","react-native-calendars": "^1.1300.0","react-native-elements": "^3.4.3","react-native-gesture-handler": "~2.14.0","react-native-get-random-values": "~1.8.0","react-native-keyboard-aware-scroll-view": "^0.9.5","react-native-modal": "^13.0.1","react-native-pager-view": "^6.3.1","react-native-paper": "^5.11.1","react-native-paper-dates": "^0.20.5","react-native-popup-menu": "^0.16.1","react-native-reanimated": "~3.6.2","react-native-reanimated-carousel": "^3.5.1","react-native-safe-area-context": "4.8.2","react-native-screens": "~3.29.0","react-native-svg": "14.1.0","react-native-tab-view": "^3.5.2","react-native-webview": "13.6.4","react-redux": "^8.1.2","redux": "^4.2.1","redux-logger": "^3.0.6","redux-persist": "^6.0.0","redux-thunk": "^2.4.2","reselect": "^4.1.8","uuid": "^9.0.1","victory-native": "^36.6.12" },"devDependencies": {"@babel/core": "^7.23.9","@babel/preset-env": "^7.23.7","@babel/preset-react": "^7.23.3","@babel/preset-typescript": "^7.23.3","@testing-library/jest-native": "^5.4.3","@testing-library/react-native": "^12.4.3","babel-jest": "^29.7.0","eslint": "^8.56.0","eslint-config-standard": "^17.1.0","eslint-plugin-import": "^2.29.1","eslint-plugin-n": "^16.6.2","eslint-plugin-promise": "^6.1.1","eslint-plugin-react": "^7.33.2","eslint-plugin-react-hooks": "^4.6.0","eslint-plugin-react-native": "^4.1.0","jest": "^29.7.0","jest-expo": "~50.0.4","react-test-renderer": "^18.2.0","remote-redux-devtools": "^0.5.16" },"private": true}
I've tried deleting node_modules then running npm install, rebuilding the app (for android) and still receiving this issue.
I see many other pages relating to this problem but none of them seem to be quite recent or relating to Expo.
Hopefully someone can lead me in the right direction with this issue.
Thanks.
I have a react native app, and I try to run the command adb reverse tcp:8081 tcp:8081 & set NODE_ENV=development & react-native run-android --list-devices --verbose --mode=DevDebug
I get, after a really long time to build ( like, 10 minutes build time ), the following error :
The device I try to install the app in is my phone, connected via Wifi to Android Studio.
I have no idea why it does that, I am a noob at RN, so I don't know what further infos you could need. I already tryied the others solutions in similar questions, but nothing is quite the same problem.
When I run the command set NODE_ENV=development & react-native start
, I have a different error because of the flavor variant, the --mode=DevDebug that is in my previous command.
Thanks in advance !
When I uploaded react-native-screens, I faced the below error:
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081Picked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-screens:configureCMakeDebug[arm64-v8a]'. > [CXX1210] C:\Users\xxx\Desktop\react_native\denemeproject\node_modules\react-native-screens\android\CMakeLists.txt debug|arm64-v8a : No compatible library found * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUİLD FAILED in 5s.
The dependencies
dependencies": {"@react-navigation/native": "^7.0.0-alpha.18","@react-navigation/native-stack": "^7.0.0-alpha.20","react": "18.2.0","react-native": "0.74.1","react-native-safe-area-context": "^4.10.1","react-native-screens": "^3.31.1" },
Node.js v20.13.1
Npm: '10.7.0',
How to fix this error?
I have a react native expo project and I want to convert it to react native cli but I am getting error -
TypeError: Cannot read property 'isConfigured' of undefinedThis error is located at: in DrawerViewBase (created by DrawerView) in RNGestureHandlerRootView (created by GestureHandlerRootView) in GestureHandlerRootView (created by DrawerView) in RCTView (created by View) in View (created by SafeAreaInsetsContext) in SafeAreaProviderCompat (created by DrawerView) in DrawerView (created by DrawerNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by DrawerNavigator) in DrawerNavigator (created by MainDrawerNavigator) in MainDrawerNavigator (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by CardContainer) in RCTView (created by View) in View (created by CardContainer) in RCTView (created by View) in View (created by CardContainer) in RCTView (created by View) in View in CardSheet (created by Card) in RCTView (created by View) in View in Unknown (created by PanGestureHandler) in PanGestureHandler (created by PanGestureHandler) in PanGestureHandler (created by Card) in RCTView (created by View) in View in Unknown (created by Card) in RCTView (created by View) in View (created by Card) in Card (created by CardContainer) in CardContainer (created by CardStack) in RNSScreen in Unknown (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by MaybeScreen) in MaybeScreen (created by CardStack) in RNSScreenContainer (created by ScreenContainer) in ScreenContainer (created by MaybeScreenContainer) in MaybeScreenContainer (created by CardStack) in RCTView (created by View) in View (created by Background) in Background (created by CardStack) in CardStack (created by HeaderShownContext) in RNCSafeAreaProvider (created by SafeAreaProvider) in SafeAreaProvider (created by SafeAreaInsetsContext) in SafeAreaProviderCompat (created by StackView) in RNGestureHandlerRootView (created by GestureHandlerRootView) in GestureHandlerRootView (created by StackView) in StackView (created by StackNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by StackNavigator) in StackNavigator (created by AppNavigator) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by AppNavigator) in AppNavigator (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in NSS_GECBSP(RootComponent), js engine: hermes error Could not open DrawerView.tsx in the editor.info When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, at signs, slashes, and underscores.error Could not open index.ts in the editor.info When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, at signs, slashes, and underscores.error Could not open index.ts in the editor.info When running on Windows, file names are checked against a whitelist to protect against remote code execution attacks. File names may consist only of alphanumeric characters (all languages), periods, dashes, at signs, slashes, and underscores.
Can anyone help with this. According to chat gpt it is related to navigation but I am unable to resolve this issue please help. If you need any file to go through then ask as I can't post all the files here.
I'm using Expo on a React Native app (react 0.59 and SDK 32), and the splash screen on Android shows a white bar at the top of the screen, like it's not a full screen.The splash images have a background color #CEECFF.
How could I avoid it?
Here is my app.json:
"expo": { ..."splash": {"image": "./assets/images/common/splash.png","resizeMode": "contain","backgroundColor": "#CEECFF" },"android": { ..."splash": {"backgroundColor": "#CEECFF","resizeMode": "contain","mdpi": "./assets/images/common/splash-mdpi.png","hdpi": "./assets/images/common/splash-hdpi.png","xhdpi": "./assets/images/common/splash-xhdpi.png","xxhdpi": "./assets/images/common/splash-xxhdpi.png","xxxhdpi": "./assets/images/common/splash-xxxhdpi.png" } } }
Thank you very much!
EDIT: looks like a behavior specific to EXPO CLI, works fine once the app is build with EXPO and tested as native on Android...
I am trying to make some portion of text of different color and clickable
Here is my code:
<Text style = {styles.term_service}>By signing up, you agree to Terms of Service and Privacy Policy.</Text>
I want to make Terms of Service and Privacy Policy clickable and have different color.
This error happen after i copy a file of my personal path, how documents, downloads, DCIM... to root path of my app, the folder of database of my app, i am using sqlite3.
So i search for solution for long time and nothing that i tried did not work.
but i just change the androidmanifest.xml, and dont work, im using react native then i should change my code?
this is my androidmanifest.xml:
<manifest><uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE"android:maxSdkVersion="28"/><uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28"/><uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/> ...<application android:requestLegacyExternalStorage="true"android:preserveLegacyExternalStorage="true" ... > ...<activity> ...</activity></application></manifest>
and this my code react native to copy to database app path:
const importDB = useCallback(async () => {try { const response = await DocumentPicker.pick({ presentationStyle: 'fullScreen', copyToCacheDirectory: true, }); setFileResponse(response); response.map((file, index) => ( ulr_import = file?.uri )); FileSystem.copyFile(ulr_import, `/data/user/0/com.app/databases/database.db` ) .then((success) => { console.log('file moved!'+success); Alert.alert('Confirmation', 'Sucess', [ {text: 'OK', onPress: () => console.log('OK Pressed')}, ]); }) .catch((err) => { console.log("Error: " + err.message); // <--- but copyFile returns "doesn't exists" error for temp.jpg Alert.alert('Erro', err.message, [ {text: 'OK', onPress: () => console.log('OK Pressed')}, ]); });} catch (err) { console.warn(err);}
}, []);
I am currently playing react-native-video elements in a flatlist and streaming videos in there with HLS. On Ios everything works fine and the preloaded video just shows up and plays instantly but on android it does not shows a white screen first and then loads the video while in view, even though it is "generated" earlier in time
Tried to debug onload,etc. and on ios videoloaded/readyfordisplay appears before i scroll to the view in the flatlist and on android it only starts buffering when the video is in the actual viewfield
In my app level build.gradle file I have enabled minification
buildTypes { debug { signingConfig signingConfigs.debug } release { signingConfig signingConfigs.release minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" }}
Then app crashes when I install the apk in my android device.
When I checked the logcat from Android Studio, I get this error.
FATAL EXCEPTION: mqt_native_modulesProcess: com.skoolbag.singleapp, PID: 7895java.lang.RuntimeException: Could not invoke RNQBSettingsModule.init at com.facebook.react.bridge.JavaMethodWrapper.invoke(Unknown Source:192) at com.facebook.react.bridge.JavaModuleWrapper.invoke(Unknown Source:147) at com.facebook.jni.NativeRunnable.run(Native Method) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(Unknown Source:0) at android.os.Looper.loopOnce(Looper.java:226) at android.os.Looper.loop(Looper.java:313) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(Unknown Source:37) at java.lang.Thread.run(Thread.java:1012)Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method)
As suggested in similar questions I checked where RNQBSettingsModule is coming from.
Therefore, I added the following code to the android/app/proguard-rules.pro file to not obfuscate this particular package.
-keep class com.quickblox.reactnative.settings.** {*;}
But this this not resolve the issue
Any one please guide me I have created app using react native cli and that application is crashed while I do turn off full screen mode to button and vise versa. and I don't get any error log.
Turning fullscreen mode on or off in my application should not cause any crashes.
I tried all things for fix avd terminated error but still stuck and cant open emulator.
What I tried :
How can i fix it ?My System variables :
I really search a lot and cant fix it anyway. Please help thanks for helps <3
I am using react native webview to rend web content in react native app.bus as soon as i try to upload file from the webview it opens the file manges and on slection of file app gets crashed
i have granted the read and write external storage.
error in android studio
E/WebEngage: App has crashed java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/document:19 flg=0x1 }} to activity {com.xyz.user.debug/com.xyz.user.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.Bundle.getString(java.lang.String)' on a null object reference
<WebView androidLayerType={'hardware'} source={{uri: "https://imgbb.com/#google_vignette"}} renderLoading={() => <AnimatedLoader isFullPageLoader={true}/>} startInLoadingState={true} style={{ marginTop: 0, marginHorizontal: 0, backgroundColor: 'white', flex:1 }} onNavigationStateChange={(e) => onNavigationStateChange(e)} onRenderProcessGone={syntheticEvent => { const { nativeEvent } = syntheticEvent; console.log('WebView Crashed: ', nativeEvent.didCrash, ); }} domStorageEnabled={true} allowFileAccessFromFileURLs={true} allowUniversalAccessFromFileURLs={true} allowFileAccess={true} mediaCapturePermissionGrantType={"prompt"} androidHardwareAccelerationDisabled={true} />
I have taken storage permission
I tried to build development build onto my emulator, yesterday it did fine. But today it got me this error:
Failed to apply plugin 'com.facebook.react.rootproject'.A problem occurred configuring project ':app'.Could not load compiled classes for build file
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {ext {buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')kotlinVersion = findProperty('android.kotlinVersion') ?: '1.8.10' ndkVersion = "25.1.8937393" } repositories { mavenCentral() google() } dependencies { classpath('com.android.tools.build:gradle') classpath('com.facebook.react:react-native-gradle-plugin') }}apply plugin: "com.facebook.react.rootproject"allprojects {repositories {maven {// All of React Native (JS, Obj-C sources, Android binaries) is installed from npmurl(new File(\['node', '--print', "require.resolve('react-native/package.json')"\].execute(null, rootDir).text.trim(), '../android'))}maven {// Android JSC is installed from npmurl(new File(\['node', '--print', "require.resolve('jsc-android/package.json', { paths: \[require.resolve('react-native/package.json')\] })"\].execute(null, rootDir).text.trim(), '../dist'))} google() mavenCentral() maven { url 'https://jitpack.io' } }}
I tried to basically go through all the gradle files to find what might be causing this error but not any luck
For some reason overnight my PC decided to change my version of gradle in gradle-wrapper.properties from 8.6 to 8.3
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distsdistributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zipnetworkTimeout=10000validateDistributionUrl=truezipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/dists
Changed it to version 8.6 and now it passes by the build