Skip to content

iOS build faild #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pantaopt opened this issue Apr 7, 2020 · 6 comments
Closed

iOS build faild #160

pantaopt opened this issue Apr 7, 2020 · 6 comments

Comments

@pantaopt
Copy link

pantaopt commented Apr 7, 2020

image
image

xcode: 11.4
macos: 10.15.4

@pantaopt
Copy link
Author

pantaopt commented Apr 7, 2020

LiquidCore version: 0.7.3
Cocoapods version: 1.9.0

@ericwlange
Copy link
Member

This is an incredibly strange set of symbols to be undefined (and just those?). Very odd.

I cannot reproduce this. What does your podfile look like?

@pantaopt
Copy link
Author

@ericwlange Thank you for your response. This is happened on my office iMac, build is ok on myself macbookpro.
The content of Podfile sent as an screenshot.

@susieyy
Copy link

susieyy commented May 25, 2020

Hi, there.
Thanks for developing a great library.

I had the same problem.
My environment is as follows.

  • Xcode: 11.4.1 or 11.5
  • macOS: 10.15.4
  • LiquidCore version: latest commit b6ebaea
  • Cocoapods version: 1.9.2
load '.liquidcore/liquidcore.rb'
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'LiquidCoreTest' do
  # liquidcore_pods
  pod 'LiquidCore', git: 'https://github.com/LiquidPlayer/LiquidCore.git', commit: 'HEAD'

  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for LiquidCoreTest

  target 'LiquidCoreTestTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'LiquidCoreTestUITests' do
    # Pods for testing
  end

end

@davidgdoyle
Copy link

davidgdoyle commented Aug 26, 2020

I've also run into this issue, and I think I finally have a satisfactory reason why it failed in the first place and what to do about it.

I spotted this in the pod install --verbose log when attempting to use this module via a Flutter plugin, after a day or so of banging my head against the problem:

 > Running prepare command
   $ /bin/bash -c  set -e bash LiquidCore/src/ios/generate_node_javascript.sh
   bash LiquidCore/src/ios/generate_javascript_polyfills.sh bash
   LiquidCore/src/ios/copy_headers.sh
   Traceback (most recent call last):
     File "tools/js2c.py", line 365, in <module>
       main()
     File "tools/js2c.py", line 362, in main
       JS2C(source_files, [natives])
     File "tools/js2c.py", line 294, in JS2C
       (consts, macros) = ReadMacros(macro_lines)
     File "tools/js2c.py", line 167, in ReadMacros
       args = map(string.strip, macro_match.group(2).split(','))
   AttributeError: module 'string' has no attribute 'strip'
   generated: /Users/dd/Library/Caches/CocoaPods/Pods/Release/LiquidCore/0.7.10-fadf5/LiquidCore/src/ios/gen/node_javascript.cc
   Generated javascript polyfill: /Users/dd/Library/Caches/CocoaPods/Pods/Release/LiquidCore/0.7.10-fadf5/LiquidCore/src/ios/gen/polyfill.c
   Copied headers to: /Users/dd/Library/Caches/CocoaPods/Pods/Release/LiquidCore/0.7.10-fadf5/LiquidCore/src/ios/gen/include
  > Copying LiquidCore from
  `/Users/dd/Library/Caches/CocoaPods/Pods/Release/LiquidCore/0.7.10-fadf5` to
  `Pods/LiquidCore`

This looks to be a python 2.7 vs python 3 error being emitted from the prepare_command step in the Pod install script. Resolving it is simple - make sure you change to use a global python 2.7 version instead. If you're seeing this on macOS, this is probably (but not strictly) down to using pyenv to use a python 3 script environment; just switch to using the system version instead.

Doing so causes all the scripts in the prepare_command to be executed completely. As a suggestion for this issue, it would be good to get the pod installation to fail with a proper error message explaining the python environment isn't right - for anyone affected by it however, it is at least simple to work around.

You will need to clean the Cocoapods cache directory and rebuild the pod after switching to python 2.7:

pod cache clean 'LiquidCore'
pod cache clean 'LiquidCore' --all
pod install

@bill19
Copy link

bill19 commented Oct 9, 2022

That's right!
Thank you, brother

#setting path for python 2.7 to .bash_profile
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
alias python="/Library/Frameworks/Python.framework/Versions/2.7/bin/python"

If you are a chip of m1, you need to download python 2.7.18 in advance!!!!!

**【非常重要】1.需要提前下载python2.7.18 !!这一点非常重要,然后确定python2.7.18可以正常在你的环境上运行起来

flutter 删掉你工程下的 pubspec.lock
删掉你的ios目录下的Podfile.lock
fluuter clean

pod cache clean 'LiquidCore'
pod cache clean 'LiquidCore' --all
pod install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants