BradLarson / GPUImage2

GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.
BSD 3-Clause "New" or "Revised" License
4.87k stars 609 forks source link

When I adding this framework to my project it start to crash!?! #269

Open Coder-ACJHP opened 6 years ago

Coder-ACJHP commented 6 years ago

Everything working nice until closing application and removing it from background then you cannot reopen the app because app immediately closing.

BradLarson commented 6 years ago

This doesn't provide much to go on. How are you using the framework? What does your code look like? When does this happen? What do you get for stack traces / console errors?

I'm sorry, but you'll need to give me a little more to go on to start diagnosing the issue here.

Coder-ACJHP commented 6 years ago

@BradLarson Thanks for replay, your'e right I've to write some explanation. The problem is occurs when I adding the framework to my project moreover without writing any code! Just add the framework to project...

I'm adding the framework with this way:

  1. Right click on the project in left navigator and choosing "Add files.."
  2. Go to Build Phases -> Add it to "Target dependencies" + "Link binary with libraries".
  3. Build the project
  4. Add "import GPUImage.." to view controller.

Then everything is working nicely but when I closing the app and removing it from the background Console message is appear with : Message from debugger: Terminated due to signal 9 and it never open again. So I need to build the app again. I noticed when I removed the framework the project it returned to work normally. Maybe I'm doing something wrong, but what is that!?!?

MacOS Version : High Sierra 10.13.6 XCode Version : 9.4.1 (9F2000) Swift Version : 4.1 Simulator : iPhone 8 Plus with OS 11.4 (15F79)

BradLarson commented 6 years ago

If you've added the framework to the project, and you link against it, you need to remember to add it to a Copy Files build phase with a location of Frameworks. Without that, the application will crash on launch due to its inability to find the framework in the application bundle. You should see this as a crash in the console when you try to run the application. Something about a missing .dylib, etc.

Coder-ACJHP commented 6 years ago

Well, I will try and inform you.

Coder-ACJHP commented 6 years ago

Hi @BradLarson I tested it again with your suggestions but still same result. You can check from the following screenshot how I'm linking the framework with my project :

ekran resmi 2018-09-10 20 47 29

And also I captured full screen gif during running app but file size is bigger than acceptable.

BradLarson commented 6 years ago

In the image above, the location is listed as "Resources". You're copying the framework into the wrong directory. It needs to be the "Frameworks" directory in the final application.

Again, if you look at the command line output you'll see it logging to the console that it is unable to find the library at runtime if this is the case. I'm betting that's what's going on here.