expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
33.14k stars 5.29k forks source link

ExpoKit iOS Project Doesn't initialise at first install on Emulator ( works after command+R) #2013

Closed wpconsulate closed 4 years ago

wpconsulate commented 6 years ago

I have an Expokit project detached from Expo, that runs fine. I build and run in XCode when I run the app in emulator ( I have to run XDE Project as well ) and then I made some changes in React Component and build the project and run it with the simulator. On First Install it doesn't show my recent changes made.

I tried many other ways along with "exp publish" which published some of my changes for inner Views. but First Screen after App install is Login. So I tried debugging and found this. When I First install the App there's nothing on Console of XDE, and Navigating to another view doesn't even call componentDidLoad ( I added alert in there which never called ). But after I do hard refresh on the emulator it seems like Expo is being initialised and app works fine ( why I'm saying this because after hard refresh I can see below logs which were there on normal first run.

Running application "main" with appParams:
{
   "rootTag":51,
   "initialProps":{
      "exp":{
         "manifest":{
            "scheme":"expb0946a6f697d470289e91264d0a40aad",
            "developer":{
               "projectRoot":"/Users/apple/Desktop/Projects/myiosapp",
               "tool":"exp"
            },
            "privacy":"unlisted",
            "assetBundlePatterns":[
               "**/*"
            ],
            "detach":{
               "androidExpoViewUrl":"https://s3.amazonaws.com/exp-exponent-view-code/android-v2.5.3-sdk27.0.0-408c8d77-8d1f-4784-b7b4-93826250663a.tar.gz",
               "iosExpoViewUrl":"https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.5.10-sdk27.0.0-7e6dd135-e649-48e2-ab7c-e76521ce6259.tar.gz"
            },
            "loadedFromCache":false,
            "platforms":[
               "ios",
               "android"
            ],
            "env":{

            },
            "isDetached":true,
            "orientation":"portrait",
            "xde":true,
            "id":"@myorgnization/myiosapp",
            "hostUri":"192.168.1.6:19000",
            "iconUrl":"http://192.168.1.6:19001/assets/./assets/icon.png",
            "mainModuleName":"node_modules/expo/AppEntry",
            "sdkVersion":"27.0.0",
            "name":"myiosapp",
            "logUrl":"http://192.168.1.6:19000/logs",
            "splash":{
               "resizeMode":"contain",
               "image":"./assets/splash.png",
               "backgroundColor":"#ffffff",
               "imageUrl":"http://192.168.1.6:19001/assets/./assets/splash.png"
            },
            "android":{
               "package":"com.myiosapp.androidApp",
               "publishBundlePath":"android/app/src/main/assets/shell-app.bundle",
               "publishManifestPath":"android/app/src/main/assets/shell-app-manifest.json"
            },
            "isVerified":true,
            "packagerOpts":{
               "lanType":"ip",
               "dev":true,
               "minify":false,
               "urlRandomness":"2a-3gv",
               "hostType":"lan"
            },
            "ios":{
               "publishBundlePath":"ios/myiosapp/Supporting/shell-app.bundle",
               "supportsTablet":true,
               "bundleIdentifier":"com.myiosapp.iosApp",
               "publishManifestPath":"ios/myiosapp/Supporting/shell-app-manifest.json"
            },
            "updates":{
               "fallbackToCacheTimeout":0
            },
            "bundleUrl":"http://192.168.1.6:19001/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&minify=false&hot=false&assetPlugin=%2FUsers%2Fapple%2FDesktop%2FProjects%2Fmyiosapp%2Fnode_modules%2Fexpo%2Ftools%2FhashAssetFiles",
            "version":"1.0.0",
            "debuggerHost":"192.168.1.6:19001",
            "icon":"./assets/icon.png",
            "slug":"myiosapp",
            "description":"myiosapp Mobile App"
         },
         "initialUri":"expb0946a6f697d470289e91264d0a40aad://192.168.1.6:19000",
         "appOwnership":"standalone",
         "shell":1
      }
   }
}
. __DEV__ === true, development-level warning are ON, performance optimizations are OFF

So above logs weren't there on first fresh install on emulator but after refreshing the app it appears and app works fine. Same issue is there on actual device but there we can't refresh the app.

So not sure how to fix it. Any help would be appriciated.

I tried:

cleaning the project rebuilding. deleting the node_modules and reinstalling NPM. deleting the webpack cache as well.

Environment Environment: OS: macOS High Sierra 10.13.4 Node: 10.1.0 Yarn: 1.7.0 npm: 6.1.0 Watchman: 4.9.0 Xcode: Xcode 9.4.1 Build version 9F2000 Android Studio: 3.1 AI-173.4819257

Packages: (wanted => installed) expo: ^28.0.0 => 28.0.0 react: 16.3.1 => 16.3.1 react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2

Diagnostics report: https://exp-xde-diagnostics.s3.amazonaws.com/iterationgroup-ab56b09b-b595-4cc4-ac1e-4e906a2bf5dc.tar.gz

Steps to Reproduce detached expo app from expo project, make changes in React Component files and try archiving app in XCode and ipa won't reflect latest changes.

wpconsulate commented 6 years ago

Any Update on this?? Seems like no activity on this?

FiberJW commented 4 years ago

Due to a lack of activity, I’m closing this issue for now. See Bare Workflow for a cleaner way to use Expo in with custom native dependencies. If you have any further related problems, please open another issue. Thanks :)