microdotblog / microblog-react

MIT License
30 stars 3 forks source link

Unable to run iOS app locally #77

Open paulrobertlloyd opened 5 months ago

paulrobertlloyd commented 5 months ago

Yarn

After running yarn ios, I get the following error:

yarn run v1.22.22
$ react-native run-ios
warn Package react-native-navigation contains invalid configuration: "dependency.assets" is not allowed,"dependency.hooks" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
info Found Xcode workspace "MicroBlog_RN.xcworkspace"
info Found booted Orin
info Building (using "xcodebuild -workspace MicroBlog_RN.xcworkspace -configuration Debug -scheme MicroBlog_RN -destination id=00008030-001934CC14D8802E")

info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 70. To debug build logs further, consider building your app with Xcode.app, by opening MicroBlog_RN.xcworkspace.
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MicroBlog_RN.xcworkspace -configuration Debug -scheme MicroBlog_RN -destination id=00008030-001934CC14D8802E

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

2024-04-24 00:58:31.676 xcodebuild[8855:66809] Writing error result bundle to /var/folders/kt/tly53kbd7qs5kb7qrls32fd80000gn/T/ResultBundle_2024-24-04_00-58-0031.xcresult
xcodebuild: error: Timed out waiting for all destinations matching the provided destination specifier to become available

        Ineligible destinations for the "MicroBlog_RN" scheme:
                { platform:iOS, arch:arm64, id:00008030-001934CC14D8802E, name:Orin, error:Device is busy (Waiting to reconnect to Orin) }

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Running npx react-native doctor returns no errors.

Xcode

Trying to build the app in Xcode, I get the following errors:

No Account for Team "3F9MDJ6K4E". Add a new account in Accounts settings or verify that your accounts have valid credentials.

No profiles for 'blog.micro.ios' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'blog.micro.ios'.

No Account for Team "3F9MDJ6K4E". Add a new account in Accounts settings or verify that your accounts have valid credentials.

No profiles for 'blog.micro.ios.MicroBlog-Share' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'blog.micro.ios.MicroBlog-Share'.

Maybe signing and provisioning issues are preventing me from building the app? It worked when I tried last year. Having downloaded 7GB to get the latest version of iOS (it wouldn’t let me build without it), perhaps something has changed in terms of requirements.

I added my iCloud account, but that generated different errors, but seemingly of the same sort.

All of which makes me soooooo very grateful I don’t develop native apps and can largely ignore Apple’s latest proclamations 😅

vincentritter commented 5 months ago

You can say that again 🤣

I suggest you open up the app in Xcode and remove the Micro.blog Team from the Signing & Capabilities tab in the project settings.

xcode-signing

Select None for both targets.

Then, when ready, and make sure you are running metro with yarn start, hit the run button and it should hopefully work — I suspect the yarn run-ios command will also work after you have removed the signing.

paulrobertlloyd commented 5 months ago

I’m not sure this is enough to get it working.

vandorsx commented 4 months ago

Try running with yarn ios instead of through Xcode — that's what worked for me. Though I first had to add #include <functional> in the FlipperTransportTypes pod

paulrobertlloyd commented 4 months ago

@in-the-trees Which file did you edit? Tried adding this to ios/pods/Flipper/xplat/Flipper/FlipperTransportTypes.h but that made no difference 😔

vincentritter commented 4 months ago

@paulrobertlloyd @in-the-trees — I will be removing Flipper from the next versions as it's deprecated and has issues with Xcode as it stands today. Not sure when I can get around to it... because I also had build errors 🤣

vandorsx commented 4 months ago

@paulrobertlloyd I think we had different issues, apologies for not reading your original post thoroughly enough the first time!

Anyways, I went through the full set up again and wrote down each step I took. Hopefully this helps:

  1. git clone git@github.com:microdotblog/microblog-react.git
  2. cd microblog-react
  3. yarn
  4. cd ios
  5. pod install
  6. Opened MicroBlog_RN.xcworkspace in Xcode
  7. Set signing team to "none" for _RN, _RNTests, and _Share
  8. Still within Xcode in Pods > Pods > Flipper > FlipperTransportTypes.h added #include <functional> after the string include
  9. cd ../
  10. yarn ios --simulator="iPhone 15 Pro"
manton commented 4 months ago

If you run into Flipper problems, you can also try this for the pod install step:

NO_FLIPPER=1 pod install