matomo-org / matomo-sdk-ios

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

Crash on app launching due to Core Data #80

Closed catjia1011 closed 6 years ago

catjia1011 commented 8 years ago

Hi, when we integrated piwik, we came into a problem that some users will crash when they launch the app. Attached is the info from Crashlytics. Hope it can be fixed and there is a new release of Piwik. Thanks!

p.s. We are using 3.3.0, which is released on May.30

Crash reports.txt

Urkman commented 8 years ago

Same here... No Fix for that?

DaliborK commented 8 years ago

I had the same issue, swift project with piwik added via pod file. The problem was with the location of of the xcdatamodel file. This change in PiwikTracker.m fix the problem "NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"/Frameworks/PiwikTracker.framework/piwiktracker" withExtension:@"momd"];"

MishraVikas1 commented 8 years ago

@mattab you hav fix for that? i'm using cocoa pod and piwik v3.6.0 Getting this error: CoreData: Cannot load NSManagedObjectModel. nil is an illegal URL parameter

DaliborK commented 8 years ago

That was the error I had. Just change the location of the modelURL in PiwikTracker.m - then you must make note of the change un case you update the pod.

MishraVikas1 commented 8 years ago

@DaliborK okay thanks. i fixed by adding resource path on the Pods-Knotalk-resources.h install_resource "PiwikTracker/PiwikTracker/piwiktracker.xcdatamodeld"

rafalkitta commented 8 years ago

Hi, is the way to fix this crash without modifying Pod? @MishraVikas1 Could you explain in more details how do you fix that?

MishraVikas1 commented 8 years ago

Hi, there is a coredata file in piwik. Add it to bundle resources. Thanks & Regards Vikas Mishra

mattab commented 8 years ago

FYI: we the Piwik team are looking for a maintainer for the iOS SDK. if you can help please comment here #91 - we need you!

kuzdu commented 7 years ago

When you implement Piwik as static library not as pod, then this error doesn't occur. I know a static library has cons, but in my case this is the better solution.

brototyp commented 6 years ago

Since this is a stale discussion and the new SDK doesn't need any Core Data anymore I will close this issue for now.

nograsby commented 6 years ago

Had same problem for second target. Add piwiktracker.xcdatamodeld to compile resources