wonday / react-native-pdf

A <Pdf /> component for react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

6.7.4 build issue

VishnuNCS opened this issue · comments

What react-native version are you using?
v0.70.9

What react-native-pdf version are you using?
v6.7.4

What platform does your issue occur on? (android/ios/both)
android

Describe your issue as precisely as possible :
In latest react-native-pdf v6.7.4 in androidManifest.xml package is missing, due to when I run the build of my project it gives below error

* Where:
Script 'D:\usersp\vishnuka\onens-esvc-fe-benefit-microapppage\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 450

* What went wrong:
A problem occurred evaluating script.
> Calling `[node, D:\usersp\vishnuka\onens-esvc-fe-benefit-microapppage\node_modules\@react-native-community\cli\build\bin.js, config]` finished with an exception. Error message: groovy.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

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.

When I found below ticket then understood that libraries that missing package name in AndroidManifest.xml gives this error
react-native-community/cli#1981 (comment)

Hi, I'm also facing the same issues. Later, I found the solution. (worked for me)

The solution for me was removing the following line
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Be sure to remove it everywhere. I had this line in build.gradle (app) and also in settings.gradle.

After that, run again npx react-native run-android the console will display the real error, fix the error and put back the lines you had removed.

In my case the error happened because I have been using an older Node version and the second time It happened I needed to sync my project again

(OR)

Upgrade the community package @react-native-community/cli
yarn upgrade @react-native-community/cli
npm update @react-native-community/cli