matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
388 stars 164 forks source link

Cannot create an NSPersistentStoreCoordinator with a nil model #44

Closed ondrejmirtes closed 10 years ago

ondrejmirtes commented 10 years ago

When integrating this library into my app via Cocoapods, additional steps are needed in order for it to work, otherwise this message pops up and the app crashes.

I had to manually create piwiktracker.momd file with momc utility from Xcode, and include it in my app bundle. Is it possible to automate this process in further versions?

mattiaslevin commented 10 years ago

That is strange. I have a number of test projects including the SDK via Cocoapods and I do not have this problem.

Are you using CoreData in you app (no only for the SDK)?

ondrejmirtes commented 10 years ago

I'm not. How exactly should the code inside PiwikTracker.m work since there's no piwiktracker.momd file available in the repository?

Ondřej Mirtes

On 7. 9. 2014, at 13:05, Mattias Levin notifications@github.com wrote:

That is strange. I have a number of test projects including the SDK via Cocoapods and I do not have this problem.

Are you using CoreData for something else in you app?

— Reply to this email directly or view it on GitHub.

mattiaslevin commented 10 years ago

Xcode will compile the xcdatamodeld into the .momd when building (the xcdatamodeld is part of the pod).

Maybe/probably your project is not executing this build step since it is not using CoreData.

I will make some test and try and figure it out.

As a workaround, try adding the xcdatamodeld to compiled sources (not a pretty solution).

joernschmidt commented 10 years ago

Hi, I have exactly the same issue though the xcdatamodeld is not part of the pod. I just executed pod update and double checked.

mattiaslevin commented 10 years ago

After some testing I see that I have the same problem as well.

The xcdatamodeld file is part of the podspec but for some reason it is not copied into the Pod. Will take a look.

max-horvath commented 10 years ago

Any plan to release a fix?

mattiaslevin commented 10 years ago

Fixed, finally. The .xcdatamodeld file needed to be included in the 'resource' section of the podspec.

Fix has been pushed to master. I do not plan on creating a new release with just this change since I have a new SDK version in the pipe (hopefully within a week). You can reference the updated podspec version directly from your Podfile until the new version is released. pod 'PiwikTracker', :git => 'https://github.com/piwik/piwik-sdk-ios.git', :commit => '8904a2d20ca060796aba0c302c3eec780b1d77aa'

Please make sure you have the latest CocoaPod version installed gem install cocoapods

There has been a couple of reports on SO about problems with xcdatamodeld, XCode6 and CocoaPods in combination. I have not run into any problems yet. http://stackoverflow.com/questions/26017913/code-signing-issue-with-xcdatamodeld-included-in-podspec

ondrejmirtes commented 10 years ago

:+1:

obrhoff commented 9 years ago

Has this issue been fixed with the latest Podfile? Getting the same problem here.