yackle / CLImageEditor

MIT License
2.22k stars 574 forks source link

Using cocapod 1.1.1 install CLimageEditor, crash when calling initWithimage #166

Closed icykey closed 7 years ago

icykey commented 7 years ago

If update to use cocapod 1.1.1 and install CLImageEditor

It crash on the following call

CLImageEditor *editor = [[CLImageEditor alloc] initWithImage:image];

Had to revert back to use cocapod 0.39.0 with oldSpec

icykey commented 7 years ago

Crash has similar call stack to this one https://github.com/yackle/CLImageEditor/issues/74

yackle commented 7 years ago

In my environment, it works fine with cocoapods 1.1.1. I recommend you to review target settings or others.

icykey commented 7 years ago

Can you share your example pod file please?

I have other pods configured the same way but only CLimageEditor has this problem

my looks like this:

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

workspace 'Myworkspace.xcworkspace'
project 'MyProject.xcodeproj'

target 'My Project Target' do
    pod 'CLImageEditor', '~> 0.1.7'
end

Thanks!

yackle commented 7 years ago

Here's my sample pod file. But your pod file also worked.

# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'

target 'sample' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for sample
  pod 'CLImageEditor'

end
icykey commented 7 years ago

Thank you for this info, I don't know what I am doing wrong then...

yackle commented 7 years ago

Does this issue occur on new project?

icykey commented 7 years ago

I just tried a new project and it works fine :(

icykey commented 7 years ago

The problem comes down to it can not find the bundle path in my old project for some reason.

    path = [[NSBundle bundleForClass:self.class] pathForResource:self.bundleName ofType:@"bundle"];
    if(path){
        return [NSBundle bundleWithPath:path];
    }
    return nil;
yackle commented 7 years ago

How about removing pod and reinstalling?

icykey commented 7 years ago

I tried removing the pod and reinstalling and same thing happens

I checked again, so the CLImageEditor.bundle does not get copied over to the simulator, that is why the path is nil.

This only happens with simulator for me so far. I tried on a real device and it works fine.

I need to find out why the bundle file does not get copied over in this case, any ideas?

I am running Xcode Version 8.1 (8B62)

icykey commented 7 years ago

Issue resolved after I removed all pod folder, pod.lock file and workspace file also the Pods.xcconfig in project. Then cleanly install pod again. I also had to manually remove everything in /Users/xxxxx/Library/Developer/Xcode/DerivedData/Project-aogarsdaowrixsbjrocomctygkid/Build/Products/Debug-iPhonesimulator/

Thank you!

yackle commented 7 years ago

👍