Skip to content
This repository was archived by the owner on Aug 28, 2021. It is now read-only.
This repository was archived by the owner on Aug 28, 2021. It is now read-only.

The Expo SDK requires Expo to run #18

@ahdam

Description

@ahdam

Hello there,

I followed the toturial, and everything is fine on iOS, but on Android, even though it builds is ok, I get this error when trying to run the app on the simulator

W/ReactNativeJS:
No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?
E/ReactNativeJS: The Expo SDK requires Expo to run. It appears the native Expo modules are unavailable and this code is not running on Expo.

versions

node: 11.6.0
npm: 6.5.0
expo-cli: 2.6.14
yarn: 1.12.3

package.json

...
"dependencies": {
    "expo": "^32.0.0",
    "expo-firebase-analytics": "^2.0.0",
    "expo-firebase-app": "^2.0.0",
    "expo-firebase-auth": "^2.0.0",
    "expo-firebase-crashlytics": "^2.0.0",
    "expo-firebase-database": "^2.0.0",
    "expo-firebase-firestore": "^2.0.0",
    "expo-firebase-functions": "^2.0.0",
    "expo-firebase-instance-id": "^2.0.0",
    "expo-firebase-invites": "^2.0.0",
    "expo-firebase-links": "^2.0.0",
    "expo-firebase-messaging": "^2.0.0",
    "expo-firebase-notifications": "^2.0.0",
    "expo-firebase-performance": "^2.0.0",
    "expo-firebase-remote-config": "^2.0.0",
    "expo-firebase-storage": "^2.0.0",
    "expokit": "32.0.1",
    "react": "16.5.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
  },
...

settings.gradle

include ':app'
def modulesDir = new File(rootDir, "../node_modules")
def includeUniversalModule = { name ->
    include ":$name"
    project(":$name").projectDir = new File(modulesDir, "$name/android")
}
[
        'expo-core',
        'expo-firebase-app'
].forEach({ moduleName -> includeUniversalModule(moduleName) })

MainActivity.java

...
  @Override
  public List<Package> expoPackages() {
    return Arrays.<Package>asList(
            new FirebaseAppPackage()
    );
  }
...

app/build.gradle ❗ (here I found some code that is not present in your tutorial)

...
api project(':expo-core')
api project(':expo-firebase-app')

// below this line is some code that isn’t present in your tutorial, but it was here after I ejected
api 'com.facebook.react:react-native:32.0.0'
api 'host.exp.exponent:expo-app-loader-provider:1.0.0'
api 'host.exp.exponent:expo-core:2.0.0'
api 'host.exp.exponent:expo-constants-interface:2.0.0'
api 'host.exp.exponent:expo-constants:2.0.0'
api 'host.exp.exponent:expo-errors:1.0.0'
api 'host.exp.exponent:expo-file-system-interface:2.0.0'
api 'host.exp.exponent:expo-file-system:2.0.0'
api 'host.exp.exponent:expo-image-loader-interface:2.0.0'
api 'host.exp.exponent:expo-permissions:2.0.0'
api 'host.exp.exponent:expo-permissions-interface:2.0.0'
api 'host.exp.exponent:expo-sensors-interface:2.0.0'
api 'host.exp.exponent:expo-react-native-adapter:2.0.0'
api 'host.exp.exponent:expo-task-manager:1.0.0'
api 'host.exp.exponent:expo-task-manager-interface:1.0.0'

// Optional universal modules, could be removed
// along with references in MainActivity
api 'host.exp.exponent:expo-ads-admob:2.0.0'
api 'host.exp.exponent:expo-app-auth:2.0.0'
api 'host.exp.exponent:expo-analytics-segment:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner-interface:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner:2.0.0'
api 'host.exp.exponent:expo-camera-interface:2.0.0'
api 'host.exp.exponent:expo-camera:2.0.0'
api 'host.exp.exponent:expo-contacts:2.0.0'
api 'host.exp.exponent:expo-face-detector:2.0.0'
api 'host.exp.exponent:expo-face-detector-interface:2.0.0'
api 'host.exp.exponent:expo-font:2.0.0'
api 'host.exp.exponent:expo-gl-cpp:2.0.0'
api 'host.exp.exponent:expo-gl:2.0.0'
api 'host.exp.exponent:expo-google-sign-in:2.0.0'
api 'host.exp.exponent:expo-local-authentication:2.0.0'
api 'host.exp.exponent:expo-localization:2.0.0'
api 'host.exp.exponent:expo-location:2.0.0'
api 'host.exp.exponent:expo-media-library:2.0.0'
api 'host.exp.exponent:expo-print:2.0.0'
api 'host.exp.exponent:expo-sensors:2.0.0'
api 'host.exp.exponent:expo-sms:2.0.0'
api 'host.exp.exponent:expo-background-fetch:1.0.0'
...

I think it's because of the expoKit/expoCore versions (which are different from the ones in the tutorial). Something is different from your version after ejecting. Can you help fix this?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions