aliyun / aliyun-oss-react-native

MIT License
148 stars 100 forks source link

IOS can't run with link aliyun-oss-react-native #13

Closed Timson020 closed 5 years ago

Timson020 commented 6 years ago

Xcode version is 9.4.1

Step

react-native init Ex

cd ./Ex

npm i aliyun-oss-react-native

react-native link aliyun-oss-react-native

// add the tdb, and two framework in Link Frameworks and Librarys

// add the AliYunOssSDK.framework in Frameworks 

but can's run

image

Error

ld: framework not found AliyunOSSiOS
clang: error: linker command failed with exit code 1 (use -v to see invocation)
luozhang002 commented 6 years ago

@Timson020 我本地尝试了react-native link aliyun-oss-react-native ,安卓这边编译是OK的,ios的确遇到了你说的这个问题,这个我在跟。 你可以先手动本地添加,是OK的。 2018-07-23 10 39 41

2018-07-23 10 44 34
Timson020 commented 6 years ago

手动添加,我这边是不行的喔。。。。 我看英文文档再试下

luozhang002 commented 6 years ago

@Timson020 第三步的 copy items if need 选项勾选上

Timson020 commented 6 years ago
image

是的 我已经勾选了

第一步需要勾选么?

Timson020 commented 6 years ago

你xcode的版本是 9.4.1么

luozhang002 commented 6 years ago

@Timson020 是的

Timson020 commented 6 years ago

。。。。 我的就是手动加入都不行 按照英文文档的来

Timson020 commented 6 years ago

如果方便的话 可以截图 整个步骤我看下么

luozhang002 commented 6 years ago

@Timson020 ,你重新react-native init X ,然后这三步 1

buhe commented 6 years ago

https://github.com/aliyun/aliyun-oss-react-native/blob/master/Example/ios/Example.xcodeproj/project.pbxproj#L1261

example add path to Header Search Path

I add below line to my project's "Framework Search Path"

"$(SRCROOT)/../node_modules/aliyun-oss-react-native/ios/AliyunSDK"

Build is pass

kala888 commented 6 years ago

一样的错误

ld: framework not found AliyunOSSiOS
clang: error: linker command failed with exit code 1 (use -v to see invocation)

image

kala888 commented 6 years ago

终于调试出来的。我发现一个问题。 对比Example,我发现在Example中ios下面有一个AliyunOSSiOS.framework的文件夹,这个哪里来的?把他拷贝到我的项目中,然后在xcode添加这个文件夹,神奇的好了。

image

之前失败,我很确定按照步骤三种的做法,我选择了“select Copy items if needed”

In XCode, in the project navigator, right click Frameworks ➜ Add Files to [your project's name]. Go to node_modules ➜ aliyun-oss-react-native ➜ AliyunSDK. Add AliyunOSSiOS.framework, and select Copy items if needed in the pop-up box.

是不是这里没有生效导致的?XCode Version 9.4.1 (9F2000)

同样法来添加AliyunOSSiOS.framework, 1,添加demo中的AliyunOSSiOS.framework可以正常使用, 2,添加node_modules中的AliyunOSSiOS.framework,报错

ld: framework not found AliyunOSSiOS,

怀疑,发布的包有问题

luozhang002 commented 6 years ago

AliyunOSSiOS.framework 这个东西是我们react-native Ios端依赖的原生ios oss sdk,这个东西其实我在项目里已经加入依赖。

CodingPapi commented 5 years ago

Any updated news?

CodingPapi commented 5 years ago

@luozhang002

vault13tech commented 5 years ago

终于调试出来的。我发现一个问题。 对比Example,我发现在Example中ios下面有一个AliyunOSSiOS.framework的文件夹,这个哪里来的?把他拷贝到我的项目中,然后在xcode添加这个文件夹,神奇的好了。

image

之前失败,我很确定按照步骤三种的做法,我选择了“select Copy items if needed”

In XCode, in the project navigator, right click Frameworks ➜ Add Files to [your project's name]. Go to node_modules ➜ aliyun-oss-react-native ➜ AliyunSDK. Add AliyunOSSiOS.framework, and select Copy items if needed in the pop-up box.

是不是这里没有生效导致的?XCode Version 9.4.1 (9F2000)

同样法来添加AliyunOSSiOS.framework, 1,添加demo中的AliyunOSSiOS.framework可以正常使用, 2,添加node_modules中的AliyunOSSiOS.framework,报错

ld: framework not found AliyunOSSiOS,

怀疑,发布的包有问题

mac-os: 10.14.2 react-native: 0.57.8 aliyun-oss-react-native: 1.0.0-alpha.7

也是遇到此問題,依 @kala888 方法,終於編譯成功...

oldfeel commented 5 years ago

按 @kala888 方法+添加ipv6那三个包,成功了

yubo725 commented 4 years ago

https://github.com/aliyun/aliyun-oss-react-native/blob/master/Example/ios/Example.xcodeproj/project.pbxproj#L1261

example add path to Header Search Path

I add below line to my project's "Framework Search Path"

"$(SRCROOT)/../node_modules/aliyun-oss-react-native/ios/AliyunSDK"

Build is pass

thanks, I followed your step and it works!