Skip to content
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

"No suitable decoder found." #3

Closed
skauthner opened this issue Nov 17, 2015 · 5 comments
Closed

"No suitable decoder found." #3

skauthner opened this issue Nov 17, 2015 · 5 comments

Comments

@skauthner
Copy link

Using the sample code, with a valid .7z file, I get the message:

Open error: Error Domain=LzmaSDKObjCReader Code=-1 "No suitable decoder found."

Running on iOS 9.1, Xcode 7.1.1.

Seems to be because CreateObject is not returning S_OK, I couldn't get further than this though?

@OlehKulykov
Copy link
Owner

  1. Check file path exists.
  2. Check path extension for correct detecting archive type, because need to create suitable decoder, plus to all, file can be encrypted.

Or create reader with predefined archive type:

/**
 @brief Initialize archive with file url and archive type.
 @param fileURL File url to the archive. Can't be nil.
 @param type Manualy defined type of the archive.
 */
- (nonnull id) initWithFileURL:(nonnull NSURL *) fileURL andType:(LzmaSDKObjCFileType) type

Also, since release 0.0.6 was added initial error processing.

@skauthner
Copy link
Author

Thanks, I'm using -initWithFileURL:andType: Also, the file does exist

It looks like the function RegisterArc() is not called to register a decoder for 7z- I don't know why though.

I also tried the sample project (i.e. 'pod try LzmaSDK-ObjC'), and it worked fine. But then I copied and pasted the sample code into my own project (ViewController.h/.m) and got the 'No suitable decoder error'. Same code, and as far as I can tell, same build settings?

@OlehKulykov
Copy link
Owner

Yes, problem in stripping big half of c++ code without initializing static vars.
Solution found - make framework, add them to embeded frameworks list.
If it's time critical for you, you could build and link manually. Build command: xcodebuild -configuration Release -project ios.xcodeproj -target MakeLzmaSDKObjCFramework -sdk iphoneos9.1 clean build than add universal LzmaSDKObjC.framework to the embeded frameworks.
screen shot
Next step - make this automatically.

@OlehKulykov
Copy link
Owner

Hello, created cocoapod with dynamic framework, you could use it.

use_frameworks!
platform :ios, '8.0'

pod 'LzmaSDKObjC', :inhibit_warnings => true

@skauthner
Copy link
Author

Awesome, thanks, I'll give this a try!

On Dec 16, 2015, at 22:59, Oleh notifications@github.com wrote:

Hello, created cocoapod with dynamic framework, you could use it.

use_frameworks!
platform :ios, '8.0'

pod 'LzmaSDKObjC', :inhibit_warnings => true

Reply to this email directly or view it on GitHub.

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

2 participants