mapbox / mapbox-navigation-ios

Turn-by-turn navigation logic and UI in Swift on iOS
https://docs.mapbox.com/ios/navigation/
Other
861 stars 313 forks source link

IB Designables Failed to render and update auto layout status for MapViewController (using CocoaPods) #210

Closed TCOA closed 7 years ago

TCOA commented 7 years ago

While I get the map and all seems to work, visually, I am getting several errors at buildtime.

Two show as 'critical' (red circles with exclamation points), though they don't stop the build: `IB Designables

`

Also related to this are three AWS issues and one MapboxNavigation one: `AWSCore 1 issue Documentation issue Parameter 'kits' not found in the function declaration Fabric.h In file included from /Applications/App/Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentiy+Fabric.m:15: In file included from /Applications/App/Pods/AWSCore/AWSCore/CognitoIdentity/AWSCognitoIdentiy+Fabric.h:18: In file included from /Applications/App/Pods/AWSCore/AWSCore/Fabric/Fabric_FABKits.h:20: Did you mean 'kitClasses'?

AWSPolly 2 issues Documentation issue Parameter 'configuration' not found in the function declaration AWSPollySynthesizeSpechURLBuilder.h In file included from /Applications/App/Pods/AWSPolly/AWSPolly/AWSPollySynthesizeSpeechURLBuilder.m:16:

Parameter 'preSignedURLRequest' not found in the function declaration AWSPollySynthesizeSpeechURLBuilder.h In file included from /Applications/App/Pods/AWSPolly/AWSPolly/AWSPollySynthesizeSpeechURLBuilder.m:16: Did you mean 'getPreSignedURLRequest'?

MapboxNavigation 1 issue Semantic Issue Method definition for 'locationManager:didUpdateLocations:' not found MGLMapView+MGLNavigationAdditions.m Method 'locationManager:didUpdateLocations:' declared here `

Note that I am currently in South America.

bsudekum commented 7 years ago

@TCOA what version are you using? could you also try cleaning (cmd + k) and rebuilding?

TCOA commented 7 years ago

not sure what part you are looking for a version, though I can tell you

cmd + k didn't seem to do anything (I saw no screen difference, etc.) and I tried various combinations with '+ k' - nothing really changed, other than a quick 'flashing' of the screen when I rebuilt and ran the app.

The issue navigator still shows these errors (along with a couple of 'missing file' things I know that I caused.... - showing picture of the errors related to adding Mapbox items):

screenshot 2017-05-10 14 00 57 screenshot 2017-05-10 14 01 18
frederoni commented 7 years ago

Are you using Carthage to install the dependencies? If that's the case, did you follow step #4?

What kind of designable do you have in your MapViewController that your storyboard can't reference? What is the MapViewController's super class?

TCOA commented 7 years ago

not using Carthage (went through various pod install issues and got a fix on those the other day)

today I (somehow) got rid of the IB Designables errors. I believe it was using the 'clean' command (recommended by @bsudekum - I found it in the menu under Product/Clean {it required a shift+cmd+k on my computer...}), though the errors did not go away until I closed xcode and restarted (after 'all else failed' attempts...), so I don't know exactly what cleared it, but they are gone.

I do still have all the other errors though. I found a recommended 'fix' at http://stackoverflow.com/questions/25338428/xcode-issue-file-xxx-png-is-missing-from-working-copy-at-project-building where it suggests doing a commit of things I know I want and then a 'Discard ALL Changes' for everything else (not what I would call a 'right answer', though perhaps that is the 'fix'? {I've seen a lot of less-than-elegant 'fixes' when working with this xcode stuff.....})

I have a couple other files that I had deleted previously still showing in the Issue navigator and it seems the 'discard' is the only way to clear them, though I haven't yet tried that.

Although I no longer have the MapViewController error, here is the class header class MapViewController: UIViewController , MGLMapViewDelegate,CLLocationManagerDelegate

It may also be of-interest to note that the MapViewController was another map page (not the one from this library), though the errors only showed up when I added this library.

frederoni commented 7 years ago

Two of the remaining errors should be filed in https://github.com/aws/aws-sdk-ios and the one related to MapboxNavigation is already ticketed in #172

Mituvinci commented 7 years ago

my problem was solved by deleting folders (which is related to this project) from derived data folder. you can do this by clicking File -> Project Setting -> then click the arrow sign deside /Users/.../Xcode/DerivedData click DerivedData folder you will see your project named folders delete those . quit xcode the open your project , clean the project by using this step Product->clean then build the project : Product->Build These will resolve this problems .

DigitalLeaves commented 7 years ago

This still happens on version 3.6.4 by October the 11th. Removing DerivedData has no effect, contrary to what's been reported by @Mituvinci. Once you add the map and setup the URL, the layout of the view controller is broken, the storyboard throws a rendering error, and it's next to impossible to work on that UIViewController on IB.

AndreALF commented 7 years ago

@DigitalLeaves thank you very much. I have been scratching my head for days trying several solutions such as Mituvinci's above. I assume we will just have to wait for fix?

DigitalLeaves commented 7 years ago

@AndreALF I'm afraid we'll have to wait. Meanwhile, I am able to edit my UIViewControllers in IB by doing the following trick: you go to the MapBox view, and remove the custom class MGLMapView. Then, AutoLayout and rendering start working again. Once you do the required modifications, you set the class of the map again to MGLMapBox.

Be careful, because if you forget to put the custom class back, the app crashes.

I hope they will provide a fix soon, as it's quite a pain in the ass being changing the class of the map's view.

nicolaslehovetzki commented 7 years ago

Another workaround is to uninstall the mapView in Interface Builder by unclicking "installed". Again you must remember to reinstall the view before running. Are you sure they are working on this ? because the issue is closed...

DigitalLeaves commented 7 years ago

Not quite sure, I thought they were. We can create a new ticket.

OliverDobner-flinc commented 6 years ago

@DigitalLeaves I am not sure this is a Mapbox issue. I am experiencing a similar Problem whenever I have an IBDesignable in a Framework and this framework imports one or more ThirdParty-Frameworks (Pods in this case). I can only work in InterfaceBuilder when I disable this dependencies. I don't have a solution at this time. PS: Take a look at this https://github.com/CocoaPods/CocoaPods/issues/5334

DigitalLeaves commented 6 years ago

@OliverMahn-flinc I don't really see how that Alamofire issue you linked relates to this issue. As I don't have other IBDesignable views coming from CocoaPods, I can really comment on that, but looks like a MapBox issue to me.

1ec5 commented 6 years ago

PS: Take a look at this CocoaPods/CocoaPods#5334

Thanks, that is indeed the root cause of this issue.

mickmgit commented 6 years ago

Installed as a downloaded zip, according to https://www.mapbox.com/install/ios/download/, and am getting this error whenever I change a UIView to MGLMapView. Xcode 9.4.1, High Sierra, MapBox downloaded from URL listed above.

Have tried some of the fixes listed above, nothing.

houmanMP commented 5 years ago

I'm having the same error:

Xcode 10.1 built for Xcode 9 - high sierra 10.13.6

mickmgit commented 5 years ago

I solved it by subclassing their main map class, (sorry, I’m blanking on the name of the class as it’s been a while), and using the subclass.

No methods, extensions, anything at all added to it, just subclass it and use that class in IB and the issue went away.

On Nov 30, 2018, at 3:40 PM, houmanMP notifications@github.com wrote:

I'm having the same error

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-ios/issues/210#issuecomment-443372943, or mute the thread https://github.com/notifications/unsubscribe-auth/ACx8-lhFr0TCzuZ508u87ayIKp3a-Qzoks5u0cIJgaJpZM4NT50g.

houmanMP commented 5 years ago

None of these solved my problem; I've used carthage for adding the framework, so even if the cocoa pods is cause of the issue, it is internal to the mapbox

mickmgit commented 5 years ago

Sorry, I don’t know anything beyond what I sent you. I went a different route and created the VC in code, not in IB.

On Dec 9, 2018, at 11:13 AM, houmanMP notifications@github.com wrote:

None of these solved my problem; I've used carthage for adding the framework, so even if the cocoa pods is cause of the issue, it is internal to the mapbox

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mapbox/mapbox-navigation-ios/issues/210#issuecomment-445563140, or mute the thread https://github.com/notifications/unsubscribe-auth/ACx8-q5ZbMp-sKJD0W9MFQg3m4hIumkUks5u3WDRgaJpZM4NT50g.