ããã°ãã¯ï¼ã½ã¡ã§ãï¼
Expoã使ã£ã¦éçºããã¦ãããï¼éä¸ã§ã©ããã¦ãNative Modulesã使ãããã¨ããã±ã¼ã¹ãåºã¦ãã¾ãï¼
ãã®å ´åã¯detach
ããå¿
è¦ãåºã¦ãã¾ãï¼
detachããå¾ã¯XCodeãAndroid Stuidoã§èªåã§ç®¡çããå¿
è¦ãåºã¦ãã¾ãã®ã§ï¼ãã®è¾ºãããèãã¦ããdetachã®éã¸é²ããã¨ããªã¹ã¹ã¡ãã¾ãï¼ãã¡ã¯æ¥µådetachã®éã¸é²ã¿ããããã¾ããï¼
detachããå¾ã§ãXDEã§èµ·åã¨ãXDEããPublishã¨ãã¯åºæ¥ã¾ãï¼ Publishã¯åºæ¥ãã¨è¨ã£ã¦ãï¼Nativeã®é¨åã¯ã±ã¢ãããªãã®ã§ãã®é¨åã¯åãã¾ããï¼ï¼ã¯ã©ãã·ã¥ããã§ããããï¼
ããã§ã¯ï¼detachã®æµãã追ãã¾ãããï¼ åºæ¬çã«ã¯ Detaching to ExpoKit ã«æ²¿ã£ã¦ã³ãã³ããå®è¡ãã¦è¡ãã°detachåºæ¥ã¾ãï¼
åãã«ï¼exp
ã³ãã³ããå¿
è¦ãªã®ã§ï¼å
¥ãã¦ããªãå ´åã¯ã¤ã³ã¹ãã¼ã«ãã¾ãï¼
$ npm install -g exp
Expoã¸ã®ãã°ã¤ã³ãå¿ è¦ãªã®ã§ï¼ãã°ã¤ã³ãã¾ãï¼
$ exp login
exp.json
ã«å¿
è¦ãªé
ç®ã追å ãã¾ãï¼
{ "name": "Your App Name", "icon": "./path/to/your/app-icon.png", "version": "1.0.0", "slug": "your-app-slug", "sdkVersion": "17.0.0", "ios": { "bundleIdentifier": "com.yourcompany.yourappname ã®ãããªã®ãå ¥ãã", }, "android": { "package": "com.yourcompany.yourappname ã®ãããªã®ãå ¥ãã", } }
ãã®å¾exp detach
ãå®è¡ããã¨è²ã
å¦çãè¡ããã¦ios
ãã£ã¬ã¯ããªãandroid
ãã£ã¬ã¯ããªãä½æãããããã¾ãï¼
$ exp detach [exp] Making sure project is set up correctly... [exp] Your project looks good! Validating project manifest... Downloading iOS code... Moving iOS project files... Naming iOS project... Configuring iOS project... Using shell config: { manifestUrl: 'exp://exp.host/@pchw/***********', isShell: true, isManifestVerificationBypassed: true } Configuring iOS dependencies... Cleaning up iOS... iOS detach is complete! Downloading Android code... Moving Android project files... Configuring Android project... Naming Android project... Cleaning up Android... Android detach is complete! Writing ExpoKit configuration... Finished detaching your project! Look in the `android` and `ios` directories for the respective native projects. Follow the ExpoKit guide at https://docs.expo.io/versions/latest/guides/expokit.html to get your project running.
XDEã§Restartãã¾ãï¼
ãã®å¾ï¼ios
ãã£ã¬ã¯ããªã«ç§»åãã¦ï¼pod install
ãè¡ã£ã¦ä¾åããã¢ã¸ã¥ã¼ã«ã®ã¤ã³ã¹ãã¼ã«ãè¡ãã¾ãï¼ããã¯çµæ§æéããããã¾ãï¼
$ cd ios $ pod install Analyzing dependencies Pre-downloading: `ExpoKit` from `http://github.com/expo/expo.git`, tag `ios/1.16.2` Fetching podspec for `React` from `../node_modules/react-native` Fetching podspec for `Yoga` from `../node_modules/react-native/ReactCommon/yoga` Downloading dependencies Installing Amplitude-iOS (3.14.1) Installing Analytics (3.6.1) Installing AppAuth (0.9.1) Installing Bolts (1.8.4) Installing Branch (0.14.12) Installing CocoaLumberjack (3.2.0) Installing Crashlytics (3.8.4) Installing ExpoKit (1.16.2) Installing FBAudienceNetwork (4.23.0) Installing FBSDKCoreKit (4.23.0) Installing FBSDKLoginKit (4.23.0) Installing FBSDKShareKit (4.23.0) Installing Fabric (1.6.11) Installing FirebaseAnalytics (3.9.0) Installing FirebaseCore (3.6.0) Installing FirebaseInstanceID (1.0.10) Installing GPUImage (0.1.7) Installing GTMOAuth2 (1.1.4) Installing GTMSessionFetcher (1.1.10) Installing Google (3.0.3) Installing GoogleMaps (2.2.0) Installing GoogleSignIn (4.0.2) Installing GoogleToolboxForMac (2.1.1) Installing React (0.44.0) Installing Yoga (0.44.0.React) Installing lottie-ios (1.5.1) Generating Pods project Integrating client project Sending stats Pod installation complete! There are 15 dependencies from the Podfile and 26 total pods installed.
è£è¶³ï¼pod installæã«ã¨ã©ã¼ãèµ·ãã£ãå ´å
æå
ã®ç°å¢ã§ã¯pod install
æã«ä»¥ä¸ã®ãããªã¨ã©ã¼ãåºã¾ããï¼
$ pod install Analyzing dependencies Pre-downloading: `ExpoKit` from `http://github.com/expo/expo.git`, tag `ios/1.16.2` Fetching podspec for `React` from `../node_modules/react-native` Fetching podspec for `Yoga` from `../node_modules/react-native/ReactCommon/yoga` [!] Unable to find a specification for `lottie-ios (~> 1.5.1)` depended upon by `ExpoKit/Core`
ãã®å ´åã¯pod setup
ãå®è¡ãï¼ãã®å¾å度pod install
ããããã¨ã§æåããããã«ãªãã¾ããï¼
$ pod setup Setting up CocoaPods master repo $ /usr/local/bin/git -C /Users/pochi/.cocoapods/repos/master fetch origin --progress remote: Counting objects: 287020, done. remote: Compressing objects: 100% (83/83), done. remote: Total 287020 (delta 52618), reused 52644 (delta 52603), pack-reused 234331 Receiving objects: 100% (287020/287020), 29.79 MiB | 432.00 KiB/s, done. Resolving deltas: 100% (193366/193366), completed with 7824 local objects. From https://github.com/CocoaPods/Specs d03518a..3c729d8 master -> origin/master $ /usr/local/bin/git -C /Users/pochi/.cocoapods/repos/master rev-parse --abbrev-ref HEAD master $ /usr/local/bin/git -C /Users/pochi/.cocoapods/repos/master reset --hard origin/master Checking out files: 100% (29533/29533), done. HEAD is now at 3c729d8 [Add] iLog 1.2.5 Setup completed
ããã¾ã§åºæ¥ãã°ï¼ãã¨ã¯ãã«ããã¦å®è¡ããã ãã§ãï¼
.xcworkspace
ã®ãã¡ã¤ã«ãXCodeã§éãã¦ãã«ãâå®è¡ã§ãè¯ãã§ããï¼ä»¥ä¸ã®ããã«react-native run-ios
ã使ãã®ã§ãããã§ãï¼
XCodeãéããããªãã®ã§ï¼react-native run-ios
ãã¾ãï¼
$ cd .. $ react-native run-ios Scanning 550 folders for symlinks in /Users/pochi/Documents/development/github/expokit/node_modules (11ms) Found Xcode workspace expokit.xcworkspace ï¼é·ãã®ã§çç¥ï¼ ** BUILD SUCCEEDED ** Installing build/Build/Products/Debug-iphonesimulator/expokit.app Launching com.yourcompany.yourappname com.yourcompany.yourappname: 82444
èªåçã«Simulatorãèµ·åãã¦å®è¡ããã¾ãï¼
ãã®ç¶æ ã§ï¼XDEã®æ¹ããbundleãããjsãé ä¿¡ããã¦ããç¶æ ã«ãªãã¾ãï¼ ãã¡ããï¼jsã®ã³ã¼ããç·¨éããã¨ããã«Simulatorã«åæ ããã¾ãï¼
ãã¨ã¯ï¼ä½¿ãããNative Modulesãã¤ã³ã¹ãã¼ã«ãã¦ï¼react-native link
ãrnpm link
ãã¦ä½¿ããã¨ãã§ãã¾ãï¼
ããã§ã¨ããããã¾ãï¼detachæåã§ãï¼