nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

ns docotor android throws cocoa pod errors

Open EdJones opened this issue 4 years ago • 10 comments

On a new Mac M1, % ns doctor android produces

✔ Getting environment information 

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.1 version and is up to date.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ 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.4.0 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.

EdJones avatar Apr 06 '21 14:04 EdJones

same issue on mac m1

nicoisz avatar May 05 '21 13:05 nicoisz

@nicoisz are you just wanting to build for Android, or do you need help getting the iOS builds set up?

EdJones avatar May 05 '21 14:05 EdJones

@EdJones i need help getting the iOS builds set up

Xcode is installed and is configured properly. ✔ xcodeproj is installed and is configured properly. ✔ 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.0 satisfies minimum required version 10. ✖ WARNING: CocoaPods is not installed or is not configured properly.

nicoisz avatar May 05 '21 18:05 nicoisz

K. This issue is about the error with Doctor and Android, but we can get you fixed up. NS doctor lumps a whole bunch of issues in with this error. Did you do this step?

sudo arch -x86_64 gem install ffi
Then

arch -x86_64 pod install

EdJones avatar May 05 '21 19:05 EdJones

when i run those commands i get [!] No `Podfile' found in the project directory.

nicoisz avatar May 05 '21 19:05 nicoisz

k. Try this: NS doctor tests for problems with CocoaPods by downloading a test folder, and then installing it. Unfortunately, it's not very specific about what it finds. Lots of things can happen, but all it reports is: "WARNING: There was a problem with CocoaPods". Bleh.

To fix the problem, you need to know the error. Heres how to get it:

  1. Find where npm packages are globally installed:
$ npm list -g | head -1
# /Users/denkan/.nvm/versions/node/v12.18.2/lib
  1. Find @nativescript/doctor folder.
$ cd /Users/denkan/.nvm/versions/node/v12.18.2/lib
$ cd node_modules/nativescript/node_modules/@nativescript/doctor
$ cd resources/cocoapods-verification/
  1. Extract the cocoapods.zip and try install
$ unzip cocoapods.zip
$ cd cocoapods
$ pod install

EdJones avatar May 05 '21 19:05 EdJones

Also, what does your ruby version look like? $ruby --version

EdJones avatar May 05 '21 19:05 EdJones

i search for those folders, and i dont have it. node_modules/nativescript/node_modules/@nativescript/doctor resources/cocoapods-verification/

this is the ruby version ruby 2.7.3p183 (2021-04-05 revision 6847ee089d) [x86_64-darwin20]

nicoisz avatar May 05 '21 20:05 nicoisz

I think you followed instructions, and installed a new ruby; when the system Ruby would have worked. The X86 is clue. I'm not at Mac now, but you'll need a ARM64 Ruby. Mine is ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20] which came from the factory.

EdJones avatar May 05 '21 22:05 EdJones

@nicoisz Here is the zip file that belongs in that folder: cocoapods.zip If you do a pod install after putting it there, you should get your real issue.

EdJones avatar May 06 '21 11:05 EdJones