printdotio / printio-ios-sdk

SDK that enables the printing of any photo, from any source, onto any product!
Other
20 stars 11 forks source link

Crash when opening PrintIO due to NSBundle initWithURL:]: nil URL argument #445

Closed arik-so closed 8 years ago

arik-so commented 9 years ago

When creating a blank project and including PrintIO using CocoaPods, everything works fine with the following code:

NSString *productionRecipeID = @"xxx";
NSString *stagingRecipeID = @"yyy";

PrintIO *printIO = [[PrintIO alloc] initWithViewController:self environment:PRINTIO_PRODUCTION productionRecipeId:productionRecipeID stagingRecipeId:stagingRecipeID];

printIO.delegate = self;
[printIO open];

However, when running that same code in a different project, there is a crash:

2015-06-17 20:28:17.817 Keepy[88396:5430898] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000107007c65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001068e3bb7 objc_exception_throw + 45
    2   CoreFoundation                      0x0000000107007b9d +[NSException raise:format:] + 205
    3   Foundation                          0x00000001043c17ca -[NSBundle initWithURL:] + 87
    4   Foundation                          0x00000001043c1879 +[NSBundle bundleWithURL:] + 45
    5   Keepy                               0x0000000100ef79c5 FONT_BLD + 256886
    6   Keepy                               0x0000000100da0b84 PRODUCT_WOVEN_BLANKETS + 17633
    7   Keepy                               0x0000000100d9ff95 PRODUCT_WOVEN_BLANKETS + 14578
    8   Keepy                               0x000000010091f831 -[HomeViewController viewDidAppear:] + 241
    9   UIKit                               0x00000001054f4ff1 -[UIViewController _setViewAppearState:isAnimating:] + 567
    10  CoreFoundation                      0x0000000106f51026 __53-[__NSArrayI enumerateObjectsWithOptions:usingBlock:]_block_invoke + 70
    11  CoreFoundation                      0x0000000106f50f5c -[__NSArrayI enumerateObjectsWithOptions:usingBlock:] + 284
    12  UIKit                               0x00000001054f5149 -[UIViewController _setViewAppearState:isAnimating:] + 911
    13  UIKit                               0x000000010551cfb9 -[UINavigationController viewDidAppear:] + 173
    14  UIKit                               0x00000001054f4ff1 -[UIViewController _setViewAppearState:isAnimating:] + 567
    15  UIKit                               0x00000001054f5b3b -[UIViewController _executeAfterAppearanceBlock] + 52
    16  UIKit                               0x00000001053e462c _applyBlockToCFArrayCopiedToStack + 314
    17  UIKit                               0x00000001053e44c5 _afterCACommitHandler + 564
    18  CoreFoundation                      0x0000000106f3aca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    19  CoreFoundation                      0x0000000106f3ac00 __CFRunLoopDoObservers + 368
    20  CoreFoundation                      0x0000000106f30a33 __CFRunLoopRun + 1123
    21  CoreFoundation                      0x0000000106f30366 CFRunLoopRunSpecific + 470
    22  GraphicsServices                    0x00000001081efa3e GSEventRunModal + 161
    23  UIKit                               0x00000001053c0900 UIApplicationMain + 1282
    24  Keepy                               0x000000010093790f main + 111
    25  libdyld.dylib                       0x0000000107574145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

That is most likely a configuration issue with the project, but as the open method is compiled, I can't really tell which exact configuration setting is incorrect.

TheTriciaRussel commented 9 years ago

@AustenB @perisicboro please advise asap as the partner Keepy is on a deadline timeline. thank you! @arik-so arik-so

AustenB commented 9 years ago

Can you email us the initialization code?

On Thu, Jun 18, 2015 at 3:12 PM, TheTriciaRussel notifications@github.com wrote:

@AustenB https://github.com/AustenB @perisicboro https://github.com/perisicboro please advise asap as the partner Keepy is on a deadline timeline. thank you! @arik-so https://github.com/arik-so arik-so

— Reply to this email directly or view it on GitHub https://github.com/printdotio/printio-ios-sdk/issues/445#issuecomment-113262592 .

Austen Bernstein Founder & CEO printio

arik-so commented 9 years ago

Of course. Which email should I send it to? I have already emailed it once to Tricia and Boro.

TheTriciaRussel commented 9 years ago

If you already sent it to Boro in an email he will get back to you tomorrow. He is 6 hours ahead of EST and 9 PST.

Tricia Russel Director of Business Development & Operations Skype: triciarussel17 print.io

On Thu, Jun 18, 2015 at 5:31 PM, Arik Sosman notifications@github.com wrote:

Of course. Which email should I send it to? I have already emailed it once to Tricia and Boro.

— Reply to this email directly or view it on GitHub https://github.com/printdotio/printio-ios-sdk/issues/445#issuecomment-113295720 .

perisicboro commented 9 years ago

Sorry for late reply, first in the morning, I will check pods, but it seems that work. Next what you can try is:

It looks like PrintIOBundle.bundle can't be found. Please verify does PrintIOBundle.bundle has target membership, and check is it in Targets -> 'your app target' -> Build Phases -> Copy Bundle Resources (should contain PrintIOBundle.bundle).

AustenB commented 9 years ago

@arik-so confirming that this fixed the issue

perisicboro commented 8 years ago

@arik-so Please confirm if it's fixed, and close a ticket.