Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Architecture - Build Failure: Unable to determine the current character, it is not a string, number, array, or object #2009

Closed
ravindraguptacapgemini opened this issue Jul 8, 2023 · 3 comments

Comments

@ravindraguptacapgemini
Copy link

Environment

System:
OS: macOS 13.4
CPU: (12) arm64 Apple M2 Pro
Memory: 194.19 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.20.0
path: /usr/local/bin/node
Yarn:
version: 1.22.19
path: /opt/homebrew/bin/yarn
npm:
version: 8.19.4
path: /usr/local/bin/npm
Watchman:
version: 2023.06.26.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/ravindragupta/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode:
version: 14.3.1/14E300c
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.19
path: /usr/bin/javac
Ruby:
version: 3.0.4
path: /Users/ravindragupta/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli":
installed: 11.3.5
wanted: ^11.3.4
react:
installed: 18.2.0
wanted: ^18.2.0
react-native:
installed: 0.72.1
wanted: 0.72.1
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: true
iOS:
hermesEnabled: true
newArchEnabled: true

Description

Recently we migrated our app to new architecture with React Native 0.72.1, debug builds are working fine but getting below error for release build with command: /bin/bash gradlew assembleRelease, error logs are as follows:

FAILURE: Build failed with an exception.

  • Where:
    Script '/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 426

  • What went wrong:
    A problem occurred evaluating script.

Calling [node, /Users/ravindragupta/Desktop/Projects/mobilev2/native/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 'C' with an int value of 67
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
Config Validation Error: "dependencies.react-native-webview.platforms.android.androidMkPath" is not allowed at readConfigFromDisk (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/node_modules/@react-native-community/cli-config/build/readConfigFromDisk.js:52:11) at loadConfig (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/node_modules/@react-native-community/cli-config/build/loadConfig.js:65:65) at setupAndRun (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/index.js:159:39) at run (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/index.js:129:11) at Object. (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/bin.js:31:3) at Module._compile (node:internal/modules/cjs/loader:1196:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10) at Module.load (node:internal/modules/cjs/loader:1074:32) at Function.Module._load (node:internal/modules/cjs/loader:909:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
^. Output: Config Validation Error: "dependencies.react-native-webview.platforms.android.androidMkPath" is not allowed at readConfigFromDisk (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/node_modules/@react-native-community/cli-config/build/readConfigFromDisk.js:52:11) at loadConfig (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/node_modules/@react-native-community/cli-config/build/loadConfig.js:65:65) at setupAndRun (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/index.js:159:39) at run (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/index.js:129:11) at Object. (/Users/ravindragupta/Desktop/Projects/mobilev2/native/node_modules/@react-native-community/cli/build/bin.js:31:3) at Module._compile (node:internal/modules/cjs/loader:1196:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10) at Module.load (node:internal/modules/cjs/loader:1074:32) at Function.Module._load (node:internal/modules/cjs/loader:909:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

Reproducible Demo

N/A

@liamjones
Copy link
Contributor

From the error message, this sounds like it's probably the same error as issue #1984?

@memanoj
Copy link

memanoj commented Jul 12, 2023

I fixed in my case by below steps

First, run

npx --quiet --no-install react-native config

Then check if you got an error message about No package name found then add a package in mainfest tag like this

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.packagename"
>

</manifest>

Also patch your package and clean Android cache by

cd android     
./gradlew clean

@szymonrybczak
Copy link
Collaborator

See #1981 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants