yandexmobile / metrica-sdk-ios

AppMetrica is a free real-time ad tracking and mobile app analytics solution.
https://tech.yandex.com/metrica-mobile-sdk/
Other
73 stars 13 forks source link

Fatal Exception: NSInvalidArgumentException #100

Open otopba opened 2 years ago

otopba commented 2 years ago
Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x9905c __exceptionPreprocess
1  libobjc.A.dylib                0x15f54 objc_exception_throw
2  CoreFoundation                 0x17601c +[NSObject(NSObject) _copyDescription]
3  CoreFoundation                 0x2e484 ___forwarding___
4  CoreFoundation                 0x2d5c0 _CF_forwarding_prep_0
5  YandexMobileMetrica            0x27618 (Missing)
6  YandexMobileMetrica            0xb214c (Missing)
7  YandexMobileMetrica            0xa1498 (Missing)
8  libdispatch.dylib              0x1c04 _dispatch_call_block_and_release
9  libdispatch.dylib              0x3950 _dispatch_client_callout
10 libdispatch.dylib              0xb0ac _dispatch_lane_serial_drain
11 libdispatch.dylib              0xbc10 _dispatch_lane_invoke
12 libdispatch.dylib              0x16318 _dispatch_workloop_worker_thread
13 libsystem_pthread.dylib        0x11b0 _pthread_wqthread
14 libsystem_pthread.dylib        0xf50 start_wqthread

I use sdk v4.0

ghost commented 2 years ago

Добрый день!Ваше письмо получено и зарегистрировано под уникальным номером № 15150847. Ответ обязательно будет предоставлен, пожалуйста, ожидайте.Просим Вас не отправлять повторное письмо по данному вопросу - оно будет считаться новой заявкой и может быть обработано позднее.Помощь сервиса: https://yandex.ru/support/direct/?from=email--С уважением,Отдел клиентского сервисател.: 8 800 234-24-80 (звонок из регионов России бесплатный)тел.: +7 495 739-37-77&nbsp11.12.2021, 13:16, "Iurii Dorofeev" @.***>: Fatal Exception: NSInvalidArgumentException 0 CoreFoundation 0x9905c exceptionPreprocess 1 libobjc.A.dylib 0x15f54 objc_exception_throw 2 CoreFoundation 0x17601c +[NSObject(NSObject) copyDescription] 3 CoreFoundation 0x2e484 forwarding___ 4 CoreFoundation 0x2d5c0 _CF_forwarding_prep_0 5 YandexMobileMetrica 0x27618 (Missing) 6 YandexMobileMetrica 0xb214c (Missing) 7 YandexMobileMetrica 0xa1498 (Missing) 8 libdispatch.dylib 0x1c04 _dispatch_call_block_and_release 9 libdispatch.dylib 0x3950 _dispatch_client_callout 10 libdispatch.dylib 0xb0ac _dispatch_lane_serial_drain 11 libdispatch.dylib 0xbc10 _dispatch_lane_invoke 12 libdispatch.dylib 0x16318 _dispatch_workloop_worker_thread 13 libsystem_pthread.dylib 0x11b0 _pthread_wqthread 14 libsystem_pthread.dylib 0xf50 start_wqthread

I use sdk v4.0

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.

eugrdn commented 2 years ago

Hey! Is there any updates on this issue?

GLinnik21 commented 2 years ago

Hi! Do you know any steps how to reproduce this bug or maybe a full crashlog?

eugrdn commented 2 years ago

Yes In my example I've just added the package (tried both v3 and v4) via SPM into the SwiftUI project After I initialise SDK at application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) method every time I try to preview any view in canvas the project crashes with the following stacktrace

CrashReportError: TestAppDev6 crashed due to an uncaught exception

TestAppDev6 crashed due to an uncaught exception `NSInvalidArgumentException`. Reason: *** -[NSFileManager contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:]: URL is nil.

Process: TestAppDev6[58486]
Date/Time: 2022-01-10 12:21:41 +0000
Log File: <none>

Application Specific Information:
     [
        dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/user/Library/Developer/Xcode/DerivedData/TestApp-czwxhgpanlnvmeakblahsozpjmly/Build/Intermediates.noindex/Previews/TestAppDev6/Products/Debug-iphonesimulator DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot//System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection DYLD_FRAMEWORK_PATH=/Users/user/Library/Developer/Xcode/DerivedData/TestApp-czwxhgpanlnvmeakblahsozpjmly/Build/Intermediates.noindex/Previews/TestAppDev6/Products/Debug-iphonesimulator 
        *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:]: URL is nil'
        terminating with uncaught exception of type NSException
        abort() called
        CoreSimulator 783.5 - Device: iPhone 13 (********-****-****-****-************) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone 13

    ]

==================================

|  MessageSendFailure: Message send failure for update
|  
|  ==================================
|  
|  |  MessageError: Connection interrupted
Application Specific Backtrace 1:
0   CoreFoundation                      0x00007fff203feba4 __exceptionPreprocess + 242
1   libobjc.A.dylib                     0x00007fff201a1be7 objc_exception_throw + 48
2   Foundation                          0x00007fff2075bfb8 -[NSFileManager contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:] + 1266
3   YandexMobileMetrica                 0x000000010a920076 +[YMMFileUtility sortedByDateContentOfDirectory:error:] + 219
4   YandexMobileMetrica                 0x000000010a91fe58 +[YMMFileUtility pathsForFilesWithExtension:] + 99
5   YandexMobileMetricaCrashes          0x0000000109f4648d +[YMMSymbolsManager enumerateCacheFilesWithBlock:] + 96
6   YandexMobileMetricaCrashes          0x0000000109f45da8 +[YMMSymbolsManager registeredApiKeys] + 151
7   YandexMobileMetricaCrashes          0x0000000109f417cb __48-[YMMCrashReporter addRegisteredCrashProcessors]_block_invoke + 65
8   YandexMobileMetrica                 0x000000010a94c2cf __28-[YMMAsyncExecutor execute:]_block_invoke + 25
9   libdispatch.dylib                   0x00007fff2011265a _dispatch_call_block_and_release + 12
10  libdispatch.dylib                   0x00007fff2011383a _dispatch_client_callout + 8
11  libdispatch.dylib                   0x00007fff20119e0c _dispatch_lane_serial_drain + 743
12  libdispatch.dylib                   0x00007fff2011a9d0 _dispatch_lane_invoke + 400
13  libdispatch.dylib                   0x00007fff2012557d _dispatch_workloop_worker_thread + 772
14  libsystem_pthread.dylib             0x00007fff6da2845d _pthread_wqthread + 314
15  libsystem_pthread.dylib             0x00007fff6da2742f start_wqthread + 15
GLinnik21 commented 2 years ago

Thank you. It would help a lot

spinogrizz commented 2 years ago

The same crash appears when trying to use SwiftUI Previews, just had to disable YMM for simulator builds as described here: https://github.com/yandexmobile/metrica-sdk-ios/issues/92#issuecomment-839584113