Jobeso / react-native-story-share

Share your images to instagram and snapchat stories with react native.
107 stars 54 forks source link

Throws error about UIImagePNGRepresentation #37

Closed gwendall closed 4 years ago

gwendall commented 4 years ago

The build fails with the following error :

'UIImagePNGRepresentation' has been replaced by instance method 'UIImage.pngData()'

coming from the following lines :

https://github.com/Jobeso/react-native-story-share/blob/ac9e0e3265dfd3590850305bbf712257e6c2fd03/ios/RNStoryShare.swift#L105

https://github.com/Jobeso/react-native-story-share/blob/ac9e0e3265dfd3590850305bbf712257e6c2fd03/ios/RNStoryShare.swift#L112

Jobeso commented 4 years ago

Might be a regression of #32 where this line was changed. Please change it in both occasions to the following and let me know if this fixes the problem for you.

= UIImage(data: decodedData)!.pngData()! as NSData
gwendall commented 4 years ago

It throws tons of other errors :

Undefined symbol: Foundation._convertErrorToNSError(Swift.Error) -> __C.NSError
Undefined symbol: Foundation.URL._bridgeToObjectiveC() -> __C.NSURL
Undefined symbol: static Foundation.URL._unconditionallyBridgeFromObjectiveC(__C.NSURL?) -> Foundation.URL
Undefined symbol: Foundation.URL.init(string: __shared Swift.String) -> Foundation.URL?
Undefined symbol: type metadata accessor for Foundation.URL
Undefined symbol: nominal type descriptor for Foundation.URL
Undefined symbol: Foundation.Data.init(contentsOf: __shared Foundation.URL, options: __C.NSDataReadingOptions) throws -> Foundation.Data
Undefined symbol: Foundation.Data._bridgeToObjectiveC() -> __C.NSData
Undefined symbol: static Foundation.Data._unconditionallyBridgeFromObjectiveC(__C.NSData?) -> Foundation.Data
Undefined symbol: value witness table for Builtin.UnknownObject
Undefined symbol: (extension in Foundation):Swift.Dictionary._bridgeToObjectiveC() -> __C.NSDictionary
Undefined symbol: Swift.Dictionary.init(dictionaryLiteral: (A, B)...) -> [A : B]
Undefined symbol: Swift.Dictionary.subscript.setter : (A) -> B?
Undefined symbol: (extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString
Undefined symbol: static (extension in Foundation):Swift.String._unconditionallyBridgeFromObjectiveC(__C.NSString?) -> Swift.String
Undefined symbol: Swift.String.init(_builtinStringLiteral: Builtin.RawPointer, utf8CodeUnitCount: Builtin.Word, isASCII: Builtin.Int1) -> Swift.String
Undefined symbol: static Swift.String.== infix(Swift.String, Swift.String) -> Swift.Bool
Undefined symbol: type metadata for Swift.String
Undefined symbol: protocol witness table for Swift.String : Swift.Hashable in Swift
Undefined symbol: (extension in Foundation):Swift.Array._bridgeToObjectiveC() -> __C.NSArray
Undefined symbol: type metadata for Swift.Bool
Undefined symbol: type metadata accessor for Swift.Optional
Undefined symbol: Swift._bridgeAnyObjectToAny(Swift.AnyObject?) -> Any
Undefined symbol: Swift._assertionFailure(_: Swift.StaticString, _: Swift.StaticString, file: Swift.StaticString, line: Swift.UInt, flags: Swift.UInt32) -> Swift.Never
Undefined symbol: Swift._allocateUninitializedArray<A>(Builtin.Word) -> ([A], Builtin.RawPointer)
Undefined symbol: Swift._bridgeAnythingToObjectiveC<A>(A) -> Swift.AnyObject
Undefined symbol: (extension in Foundation):Swift.Error.localizedDescription.getter : Swift.String
Undefined symbol: type metadata for Any
Undefined symbol: _swift_allocObject
Undefined symbol: _swift_bridgeObjectRelease
Undefined symbol: _swift_bridgeObjectRetain
Undefined symbol: _swift_deallocObject
Undefined symbol: _swift_errorRelease
Undefined symbol: _swift_errorRetain
Undefined symbol: _swift_getErrorValue
Undefined symbol: _swift_getFunctionReplacement
Undefined symbol: _swift_getInitializedObjCClass
Undefined symbol: _swift_getObjCClassFromMetadata
Undefined symbol: _swift_getObjCClassMetadata
Undefined symbol: _swift_getOrigOfReplaceable
Undefined symbol: _swift_getSingletonMetadata
Undefined symbol: _swift_getTypeByMangledNameInContext
Undefined symbol: _swift_isaMask
Undefined symbol: _swift_release
Undefined symbol: _swift_retain
Undefined symbol: _swift_unknownObjectRelease
Undefined symbol: _swift_unknownObjectRetain
Undefined symbol: _swift_updateClassMetadata2
Undefined symbol: _swift_willThrow
gwendall commented 4 years ago

Ok so I fixed it.

  1. I added an empty swift file to my project, fix here : https://github.com/mxcl/PromiseKit/issues/1059#issuecomment-493925940

  2. I had another error afterwards that was due to the podspec file, fix here : https://github.com/Jobeso/react-native-story-share/issues/28#issuecomment-591830083

Thanks !