I am currenly tryign to build React native app on an ubuntu system . I am facing build error when I am including react-native-pdf package
The current character read is ‘i’ with an int value of 105
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
info Run CLI with –verbose flag for more details.
^. Output: info Run CLI with –verbose flag for more details.
- 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
BUILD FAILED in 2s
at makeError (/home/frostdev7506/Documents/greattr/GreattrNative/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /home/frostdev7506/Documents/greattr/GreattrNative/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/home/frostdev7506/Documents/greattr/GreattrNative/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/home/frostdev7506/Documents/greattr/GreattrNative/node_modules/@react-native-community/cli/build/index.js:142:9)
info Run CLI with –verbose flag for more details.
I tried different older versions of react-native-pdf package but having similar issue. When I remove the package and clean install node modules again , I am able to build without any issue . Even ./gradlew clean is not working. I have tried all the solutions like
deleting android/build folder
remvoing and clean installing node modules
running gradlew -clean (not working )
I am also linking my package.json for reference
{
"name": "--------",
"version": "0.2.8",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"clean": "react-native-clean-project",
"lint": "eslint ."
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.17.11",
"@react-native-community/datetimepicker": "^6.7.1",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-firebase/app": "^16.5.0",
"@react-native-firebase/messaging": "^16.5.0",
"@react-native-picker/picker": "^2.4.8",
"@react-navigation/bottom-tabs": "^6.5.2",
"@react-navigation/drawer": "^6.5.6",
"@react-navigation/native": "^6.1.1",
"@react-navigation/native-stack": "^6.9.6",
"@react-navigation/stack": "^6.3.10",
"axios": "^1.2.2",
"crypto-js": "^4.1.1",
"i": "^0.3.7",
"i18next": "^22.4.6",
"lottie-react-native": "^6.4.0",
"npm": "^9.4.1",
"react": "18.1.0",
"react-hook-form": "^7.46.0",
"react-i18next": "^12.1.1",
"react-native": "0.70.6",
"react-native-blob-util": "^0.17.1",
"react-native-crypto-js": "^1.0.0",
"react-native-datepicker": "^1.7.2",
"react-native-deck-swiper": "^2.0.15",
"react-native-device-info": "^10.8.0",
"react-native-dotenv": "^3.4.7",
"react-native-elements": "^3.4.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.8.0",
"react-native-image-picker": "^4.10.2",
"react-native-linear-gradient": "^2.8.2",
"react-native-loading-dots": "^1.3.2",
"react-native-localize": "^2.2.4",
"react-native-modal": "^13.0.1",
"react-native-pdf": "^6.7.1",
"react-native-push-notification": "^8.1.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-screens": "^3.20.0",
"react-native-simple-toast": "^2.0.0",
"react-native-splash-screen": "^3.3.0",
"react-native-svg": "^13.12.0",
"react-native-swiper": "^1.6.0",
"react-native-table-component": "^1.2.2",
"react-native-vector-icons": "^9.2.0",
"react-navigation": "^4.4.4"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@babel/runtime": "^7.12.5",
"@react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "0.72.3",
"react-native-clean-project": "^4.0.1",
"react-test-renderer": "18.1.0"
},
"jest": {
"preset": "react-native"
}
}