agilebits / onepassword-app-extension

1Password Extension for iOS Apps
2.58k stars 311 forks source link

WebView Demo Crashing #360

Closed kspearrin closed 7 years ago

kspearrin commented 7 years ago

Hi. I'm trying to run the web view swift demo on an iPhone 6s device (iOS 10.0.2, xcode 8.1) and it is crashing whenever I click on the 1Password icon at the top (which opens the app extension menu at the bottom). I see the extension menu open for a split second and then it crashes the demo app.

2016-11-10 23:11:43.674165 WebView Demo for iOS Swift[11990:6386729] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2016-11-10 23:11:44.720872 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToTwitter => com.apple.share.Twitter.post
2016-11-10 23:11:44.720936 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToFacebook => com.apple.share.Facebook.post
2016-11-10 23:11:44.720966 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToWeibo => com.apple.share.SinaWeibo.post
2016-11-10 23:11:44.720993 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.TencentWeibo => com.apple.share.TencentWeibo.post
2016-11-10 23:11:44.721018 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToFlickr => com.apple.share.Flickr.post
2016-11-10 23:11:44.721042 WebView Demo for iOS Swift[11990:6386729] [core] SLComposeViewController extensionIdentifierForActivityType: com.apple.UIKit.activity.PostToVimeo => com.apple.share.Vimeo.post
2016-11-10 23:11:44.755700 WebView Demo for iOS Swift[11990:6386729] [MC] Reading from public effective user settings.
2016-11-10 23:11:45.262570 WebView Demo for iOS Swift[11990:6386729] [MC] Filtering mail sheet accounts for bundle ID: com.agilebits.WebView-Demo-for-iOS-Swift, source account management: 1
2016-11-10 23:11:45.266475 WebView Demo for iOS Swift[11990:6386729] [MC] Result: YES
2016-11-10 23:11:45.266716 WebView Demo for iOS Swift[11990:6386729] [MC] Filtering mail sheet accounts for bundle ID: com.agilebits.WebView-Demo-for-iOS-Swift, source account management: 1
2016-11-10 23:11:45.268925 WebView Demo for iOS Swift[11990:6386729] [MC] Result: YES
WebView Demo for iOS Swift(11990,0x1b2a4ac40) malloc: *** error for object 0x1742a0f60: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
gks commented 7 years ago

Hi @kspearrin

I'm using iOS 10.1.1 here (latest version available), Xcode 8.1 (build 8B62) with 1Password 6.5b35 (latest from TestFlight). No problems that I can see.

I then tried with the stable App Store version, otherwise same config above, also no trouble.

Are you running from master or another branch?

kspearrin commented 7 years ago

This was from the master branch as of last night. I'll update my device to 10.1.1 and try again tonight. Another weird thing was when I ran the demo from the simulator it did not even show the 1Password icon button at the top near the address bar. It was just an empty space there with nothing to press.

gks commented 7 years ago

Hi @kspearrin

Running in a simulator won't work because the code checks if 1Password is installed. Unless you have 1Password installed in the simulator it won't show the icon. Since the code in this repository is simply the scaffolding to allow developers to invoke 1Password's extension (which is built into 1Password itself), the extension code here can't operate without it.

I'd be curious if upgrading fixes things for you, but I'm guessing that's probably not the issue. I'd still suggest it. There were some security updates in more recent iOS updates that you should probably upgrade for anyway :)

kspearrin commented 7 years ago

Ok, yea that makes sense about the simulator issue. I'll report back tonight after updating, but like you, I'm not so sure that is going to change anything. This used to work last time I tried this same thing several months ago when I was on iOS 9 and the previous version of Xcode (not sure what that was anymore now that I updated).

kspearrin commented 7 years ago

I found the issue. I noticed that is was only crashing when my phone was connected to the Macbook. Turns out my phone was paired with Safari on my Macbook for web inspector debugging of JS contexts.

Turning off the Safari > Develop > My iPhone > "Automatically Show Web Inspector for JSContexts" fixed the crashing.

Thanks for having a look anyways.