简体   繁体   English

Paytm库2.1与iOS链接器错误集成?

[英]Paytm library 2.1 integration with iOS Linker Error?

Following linker error with duplicate symbol showing while integrating Paytm library for iOS. 以下链接器错误,在为iOS集成Paytm库时显示重复符号。 Here is few line of error : 这里有几行错误:

duplicate symbol _OBJCIVAR$_Reachability.reachabilityRef in : Library/Paytm/libPaymentsSDK.a(Reachability.o) ld: 9 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 重复符号_OBJCIVAR $ _Reachability.reachabilityRef in:Library / Paytm / libPaymentsSDK.a(Reachability.o)​​ld:9个架构i386 clang的重复符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)

Please help me out to fix this issue . 请帮我解决这个问题。

*Note 1 - When i wrote to discussion forum i got reply : *注1 - 当我写信给讨论论坛时,我得到了回复:

"issue is your Reachability class has same name as of paytm Reachability class so simply solution is to change the name of your Reachability class " “问题是您的Reachability类与paytm Reachability类同名,所以简单的解决方案是更改您的Reachability类的名称”

but the problem is to change the reachability class name in the entire project is not a feasible solution . 但问题是在整个项目中更改可达性类名称是不可行的解决方案。

*Note 2 :- *笔记2 :-

Using Xcode7.2 along with Mac OSX 10.11.2 (Objective C - Language ) 使用Xcode7.2和Mac OSX 10.11.2(目标C - 语言)

*Note 3 :- *注3: -

in Paytm library there is a header file having name : PaymentsSDK.h which have 在Paytm库中有一个名称为PaymentsSDK.h的头文件

//Reusable Class Redefines to avoid name clashes
//#define Reachability PGReachability

when i uncomment above line .. still it is giving error ?? 当我取消注释以上行..仍然是给错误?

Any help will be greatly appreciated. 任何帮助将不胜感激。 Thanks. 谢谢。

Use the latest version of the PG SDK library from Paytm. 使用Paytm的最新版PG SDK库。 They have fixed the problem. 他们已经解决了这个问题。 Recently few merchants had reported that issue. 最近很少有商家报道过这个问题。 So they have fixed it by renaming that class so that it does not clash with yours. 所以他们通过重命名这个类来修复它,这样它就不会与你的类冲突。

Remove the Reachability Class .m file from your Project and Run. 从项目和运行中删除Reachability Class .m文件。 This will work. 这会奏效。

Go to Project Settings -> Build Phases -> Compile Sources -> Select Reachability.m -> Delete it. 转到项目设置 - >构建阶段 - >编译源 - >选择Reachability.m - >删除它。

This won't delete the file from the system, only from the compilation. 这不会从编译中删除系统中的文件。 The header will be used and the implementation won't be duplicated. 将使用标头,并且不会重复实现。

(Also You can remove the file from Paytm SDK thourgh terminal.) (您也可以从Paytm SDK thourgh终端中删除该文件。)

SOLVED..!!! 解决了..!!!

I have deleted my own " Reachability " class and used " SCNetworkReachability ". 我删除了自己的“ Reachability ”类并使用了“ SCNetworkReachability ”。 And modified all my old reachability methods with the new class. 并使用新类修改了所有旧的可访问性方法。

https://cocoapods.org/pods/SCNetworkReachability https://cocoapods.org/pods/SCNetworkReachability

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM