Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedBear Duo App crashes with iOS v11 #35

Open
Cheong2K opened this issue Sep 28, 2017 · 10 comments
Open

RedBear Duo App crashes with iOS v11 #35

Cheong2K opened this issue Sep 28, 2017 · 10 comments

Comments

@Cheong2K
Copy link
Collaborator

On iOS version 11, using the RedBear Duo App, when I try associating the Duo to a Wi-Fi Access Point/Router, the App crashed.

It works fine on iOS 10.

@OhHeyAlan
Copy link

Doesn’t work for me on iOS 11.2.6
The app just crashes.

@saamerm
Copy link

saamerm commented Aug 14, 2018

I'm not that adept in Swift (just C#) but I tried to clone the project and see where the exception occurs, and I got

"Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value"

around line 666 (number may be greater than actual because of my comments) of the DuoWifiProvisioningViewController file at this call "alert.addAction(self.passAlertAction!)"

The self.passAlertAction is null and I tried to follow https://stackoverflow.com/questions/32170456/what-does-fatal-error-unexpectedly-found-nil-while-unwrapping-an-optional-valu but I have no idea what he's saying

Not a 100% sure what I can do about it, any ideas @Cheong2K @OhHeyAlan @XuGuohui or @ChiHung ?
This issue has made my RedBear Duo useless 😿

@Danappelxx
Copy link

It looks like the issue is that self.passAlertAction is weak but is assigned to directly from allocation. As such it is immediately deallocated and afterwards crashes when unwrapped, at least some of the time (undefined behavior unfortunately). The fix for this is straightforward - simply allocate it on the stack and then pass ownership to the alert. I'll submit a pull request.

@Danappelxx
Copy link

Made the pull request. Let's hope it gets merged! @saamerm I would appreciate if you could test it to make sure my theory is correct.

@saamerm
Copy link

saamerm commented Aug 14, 2018

Verified! @Danappelxx 's PR fixes the crash.
To test it/use a working copy:

  1. you need a Mac with xcode,
  2. then clone his Duo repo, switch to the right branch
  3. Change the bundle identifier and the provisioning profile to random test stuff,
  4. Connect your phone and Build

@wywarren
Copy link

I cloned the repo but I'm getting an error with the link to Pods_RedBear_Duo.framework . Do I need to build the pods framework separately first? If so how? I do see the pods folder in the iOS project folder but it's just a bunch of nested frameworks inside another project. I suspect the SparkSetup error I'm getting is related to this missing framework?

Thanks for any help you guys can provide. I'm also on iOS 11 and the app store app is crashing on me.

@saamerm
Copy link

saamerm commented Aug 17, 2018

@wywarren Hey Warren
Im not sure why you are getting that error :/
Did you open the workspace and do you have the latest version of Xcode installed?

@Danappelxx
Copy link

@wywarren you need to download cocoapods (gem install cocoapods) and run pod install, and then everything should build.

@wywarren
Copy link

I ended up opening the DuoApp xcode project and then dragging the Pods excode project file into the DuoApp's project and everything built as expected. I also ran the cocoapods as @Danappelxx suggested. Not sure if that helped it as well. But it got rid of the SparkSetup error as the source code was actually in the project now. Time to continue tinkering. Thanks for the help guys.

@wywarren
Copy link

Just a note: The commenting on DuoBLEProvisionTableViewController.swift should have the filename fixed on line #3
// DuoWifiProvisionTableViewController.swift
This caused a bit of confusion for me thinking I was editing the wrong file at one point.

But yes after updating the Wifi and BLE swift files everything seems to build and not crash now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants