Kshitij Bajracharya
Kshitij Bajracharya

Reputation: 851

Expo eject results in error Cannot read property 'resources' of null

I created an app using expo. Now, I want to eject the application and I did

expo eject

After this, I get the following error:

Warning! Your git working tree is dirty.
It's recommended to commit all your changes before proceeding, so you can revert the changes made by this command if necessary.

✔ Would you like to proceed? … yes

✔ Created native projects | /android, /ios already created | gitignore already synced
✔ Updated package.json and added index.js entry point for iOS and Android.
🧶 Using Yarn to install packages. Pass --npm to use npm instead.
✔ Installed JavaScript dependencies.
Cannot read property 'resources' of null
TypeError: Cannot read property 'resources' of null
    at setColorItem (/Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/config-plugins/src/android/Colors.ts:19:29)
    at Object.assignColorValue (/Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/config-plugins/src/android/Colors.ts:63:12)
    at setSplashColorsForTheme (/Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts:79:17)
    at /Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/prebuild-config/src/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.ts:23:25
    at action (/Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/config-plugins/src/plugins/withMod.ts:214:29)
    at interceptingMod (/Users/kshitijbajracharya/Documents/work/convergetree/doodle/weather-app-react-native/node_modules/@expo/config-plugins/src/plugins/withMod.ts:100:27)
    at evalModsAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/src/plugins/mod-compiler.ts:145:32)
    at compileModsAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/config-plugins/src/plugins/mod-compiler.ts:82:10)
    at configureManagedProjectAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/src/commands/eject/configureProjectAsync.ts:63:12)
    at prebuildAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/src/commands/eject/prebuildAsync.ts:92:25)
    at ejectAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/src/commands/eject/ejectAsync.ts:23:19)
    at actionAsync (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/src/commands/eject.ts:47:5)
    at Command.<anonymous> (/Users/kshitijbajracharya/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/src/exp.ts:350:7)

How do I resolve this? Where is the resource that is being set to null?

Upvotes: 2

Views: 2229

Answers (3)

Baymax Hiro
Baymax Hiro

Reputation: 1

I had the same issue and it was solved by removing colors.xml.

android/app/src/main/res/values/colors.xml

Upvotes: -1

denisvlr
denisvlr

Reputation: 58

Upgrade to latest expo-cli version:

npm install -g expo-cli

Upvotes: 2

hong developer
hong developer

Reputation: 13916

Run commands were introduced in SDK 41.

You can use expo prebuild

expo prebuild

Experimental: Create native iOS and Android project files before building natively. Learn more: https://docs.expo.dev/workflow/customizing/

Documents for reference

enter image description here

Upvotes: 0

Related Questions