Skip to content

TypeError: Cannot convert undefined or null to object when building for android #583

Closed
@FortunaRegem

Description

@FortunaRegem

Environment

System:
OS: Windows 10
CPU: (6) x64 Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
Memory: 8.59 GB / 15.94 GB
Binaries:
Node: 10.15.0 - C:\Program Files\nodejs\node.EXE
npm: 6.10.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842

Description

After updating app react-native from 0.57.8 to 0.60.4 and all other libraries i got the following issue:

`
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\VisualStudio Code\AppName\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 190

  • What went wrong:
    A problem occurred evaluating settings 'AppName'.

Unable to determine the current character, it is not a string, number, array, or object

The current character read is 'T' with an int value of 84
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
TypeError: Cannot convert undefined or null to object at Function.keys () at isValidRNDependency (D:\VisualStudio Code\AppName\node_modules\react-native\node_modules@react-native-community\cli\build\commands\config\config.js:13:109) at Object.keys.forEach.item (D:\VisualStudio Code\AppName\node_modules\react-native\node_modules@react-native-community\cli\build\commands\config\config.js:20:10) at Array.forEach () at filterConfig (D:\VisualStudio Code\AppName\node_modules\react-native\node_modules@react-native-community\cli\build\commands\config\config.js:19:38) at Object.func (D:\VisualStudio Code\AppName\node_modules\react-native\node_modules@react-native-community\cli\build\commands\config\config.js:31:32) at Command.handleAction (D:\VisualStudio Code\AppName\node_modules\react-native\node_modules@react-native-community\cli\build\cliEntry.js:160:21) at Command.listener (D:\VisualStudio Code\AppName\node_modules\commander\index.js:315:8) at Command.emit (events.js:182:13) at Command.parseArgs (D:\VisualStudio Code\AppName\node_modules\commander\index.js:651:12)
`

Error occurs while running any gradle command lik for example ./gradlew clean or ./graldew assembleDebug

Reproducible Demo

  1. Upgrade project libraries and react-native from 0.57.8 to 0.60.4 and use migration to androidX
  2. Run any gradle command

package.json file:

{
"name": "AppName",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/geolocation": "^1.4.2",
"@react-native-community/netinfo": "^4.1.3",
"geolib": "^3.0.4",
"react": "^16.8.6",
"react-native": "0.60.4",
"react-native-admob-dfp": "^2.0.0-beta.3.9",
"react-native-android-location-enabler": "^1.2.0",
"react-native-app-settings": "^2.0.1",
"react-native-background-fetch": "^2.6.1",
"react-native-background-geolocation": "^3.0.9",
"react-native-device-info": "^2.3.0",
"react-native-firebase": "^5.5.5",
"react-native-geolocation-service": "^3.0.0",
"react-native-gesture-handler": "^1.3.0",
"react-native-image-pan-zoom": "^2.1.11",
"react-native-maps": "^0.25.0",
"react-native-navigation-directions": "^1.0.3",
"react-native-permissions": "^1.2.0",
"react-native-phone-call": "^1.0.9",
"react-native-popup-dialog": "^0.18.3",
"react-native-responsive-screen": "^1.2.2",
"react-native-screens": "^1.0.0-alpha.23",
"react-native-side-drawer": "^1.1.9",
"react-native-spinkit": "^1.4.0",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^9.5.3",
"react-native-swipe-gestures": "^1.0.3",
"react-navigation": "^3.11.1",
"react-navigation-transitions": "^1.0.11",
"realm": "^3.0.0-beta.2"
},
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/runtime": "7.5.5",
"@react-native-community/eslint-config": "0.0.3",
"babel-jest": "24.8.0",
"babel-plugin-transform-remove-console": "6.9.4",
"eslint": "6.1.0",
"jest": "24.8.0",
"metro-react-native-babel-preset": "0.54.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions