Tencent / libpag

The official rendering library for PAG (Portable Animated Graphics) files that renders After Effects animations natively across multiple platforms.
https://pag.art
Other
4.73k stars 437 forks source link

github demo iOS平台编译 PAGViewer.xcworkspace 失败 #2179

Closed tgitpushping closed 2 months ago

tgitpushping commented 2 months ago

下载github最新代码,按md文件配置了环境,node信息如下,依然报错

~ % node Welcome to Node.js v21.6.2.

Developer/Xcode/DerivedData/PAGViewer-hkrcmotjtonydkepmfylcxescutt/Build/Intermediates.noindex/PAG.build/Debug-iphoneos/tgfx-vendor.build/Script-D1066797E77D21E0E6E78929.sh: line 5: node: command not found

【版本信息】

master分支最新代码

【平台信息】

iOS 原生

【预期的表现】

编译 PAGViewer.xcworkspace 可以正常编译通过

【实际的情况】

失败

kevingpqi123 commented 2 months ago

这部分已经很成熟了,请严格按照步骤来,不要放过每一个报错,将操作步骤和第一个报错信息发出来

tgitpushping commented 2 months ago

操作步骤如下:

【电脑环境】 Apple M3 Pro 14.1 (23B2073)

Xcode Version 15.1 (15C65) gcc version 15.0.0 nodejs v21.6.2

【执行步骤】

1、执行./sync_deps.sh,使用sudo + ./sync_deps.sh 命令执行 -- 无异常

2、执行 sudo npm install -g depsync 命令,提示如下:

changed 4 packages in 101ms

1 package is looking for funding run npm fund for details

3、执行depsync 无异常

4、使用CLion 编译项目,可以编译成功。提示如下: -- Configuring done (1.9s) -- Generating done (0.1s) -- Build files have been written to: /Users/yanzi/Documents/Project/PAG/libpag/cmake-build-debug 此目录底下有libpag.framework 的产物

5、cd到iOS目录 ,执行./gen_ios 生成了,PAGViewer.xcworkspace 文件

6、点击PAGViewer.xcworkspace 文件, 并配置 bundleid 及 pp描述文件进行编译,报错(此步骤选择的target是PAGViewer)。报错内容如上,并配置了本地的node.js的访问路径。设置了 ~/.bashrc 和 ~/.zshrc

kevingpqi123 commented 2 months ago

这里没那么麻烦,对于 iOS,在 macOS 平台上 git 拉取仓库源码后: 1、image 执行脚本看是否有报错

npm install -g depsync 是其它平台的,不需要执行

2、1 无报错,在 ios 目录下

image

然后修改相关配置运行 PAGViewer.xcworkspace 即可