Nativescript TNS запускает ios Mac mini (M1) : ПРЕДУПРЕЖДЕНИЕ: Возникла проблема с CocoaPods

#macos #cocoapods #nativescript #apple-m1

Вопрос:

Я действительно не знаю, что мне теперь делать, чтобы я мог создать приложение Nativescript для ios на Mac Mini (M1). Я просмотрел все темы на SOF и сделал следующее:

Но когда я это делаю tns run ios , я получаю ошибку ниже.

Я также пытался установить cocoapods с помощью терминала в режиме Rosetta, но безрезультатно. У меня все работало на компьютере Mac Mini 2014 под управлением Big Sur, но Mac mini M1 ему просто не нравится.

 ✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✖ WARNING: There was a problem with CocoaPods 
 Verify that CocoaPods are configured properly. 

Your environment is not configured properly and you will not be able to execute local builds.
Select "Configure for Local Builds" to run the setup script and automatically configure your environment for local builds.
Select "Skip Step and Configure Manually" to disregard this option and install any required components manually.
? To continue, choose one of the following options:  › - Use arrow-keys. Return to submit.
❯   Configure for Local Builds
    Skip Step and Configure Manually
 

Когда я выбираю Настройку для локальных сборок, я получаю следующий журнал:

     Step 5 of 11:
Installing CocoaPods... This might take some time, please, be patient.
Successfully installed cocoapods-1.10.2
Parsing documentation for cocoapods-1.10.2
Done installing documentation for cocoapods after 0 seconds
1 gem installed
Step 6 of 11:
Setup CocoaPods... This might take some time, please, be patient.
Setup completed
Step 7 of 11:
Installing pip... This might take some time, please, be patient.
Searching for pip
Best match: pip 20.3.3
Processing pip-20.3.3-py2.7.egg
pip 20.3.3 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip3.8 script to /usr/local/bin
Installing pip3 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/pip-20.3.3-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
Step 8 of 11:
Installing 'six' python package... This might take some time, please, be patient.
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (1.12.0)
Step 9 of 11:
Installing xcodeproj... This might take some time, please, be patient.
Successfully installed xcodeproj-1.21.0
Parsing documentation for xcodeproj-1.21.0
Done installing documentation for xcodeproj after 0 seconds
1 gem installed
The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile/.zprofile
Restart the terminal or run `source ~/.bash_profile` to use them.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✖ WARNING: There was a problem with CocoaPods 
 Verify that CocoaPods are configured properly. 

The setup script was not able to configure your environment for local builds. To execute local builds, you have to set up your environment manually. Please consult our setup instructions here 'https://docs.nativescript.org/start/quick-setup'.
 

Ответ №1:

Для машин M1 рекомендуется повторно установить rosetta2

 softwareupdate --install-rosetta
 

Возможно, потребуется установить ffi

 sudo arch -x86_64 gem install ffi
 

Затем из папки проект/платформы/ios

 arch -x86_64 pod install