Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all articles
Browse latest Browse all 7188

GoogleMaps SDK crashing app after modularization of project

$
0
0

I have a working project with GoogleMaps in it that works fine. I made a copy of that project to make the project modular and now I get an EXC_BAD_ACCESS error when I try to open the map.

here is my pod configuration:

def shared_pods
    ...
end

def application_pods
    ...
    pod 'GoogleMaps'#, :modular_headers => true
    pod 'GooglePlaces', :modular_headers => true
end


def core_application_pods
...
    pod 'GooglePlaces', :modular_headers => true
end


target 'Application' do

  project 'Application/Application.xcodeproj'

  # Pods for Application

  shared_pods
  application_pods

  target 'ApplicationTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ApplicationUITests' do
    # Pods for testing
  end
end

target 'Core' do

    project 'Core/Core.xcodeproj'

    # Pods for Core

    shared_pods
    core_application_pods

    target 'CoreTests' do
      inherit! :search_paths
      # Pods for testing
    end
end

I even tried putting both pods in shared_pods, enable/disable modular_headers and there is no difference in the outcome.

Here is some of the code which creates the UIGMapsView object. The object is created successfully and Maps delegates are fired before the crash..

final fileprivate func setupMapViewConstraints() {
        if self.mapView == nil {
            let mapView = UIGMapsView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
            mapView.gmapDelegate = self
            mapView.translatesAutoresizingMaskIntoConstraints = false
            mapView.settings.myLocationButton = false
            self.mapView = mapView
        }

        if let mapView = self.mapView {

            self.view.addSubview(mapView)
                self.view.sendSubviewToBack(mapView)

            let views : [String: UIView] = ["mapView": mapView]
            let vertical = NSLayoutConstraint.constraints(withVisualFormat: "V:|[mapView]|", options: [], metrics: nil, views: views)
            let horizontal = NSLayoutConstraint.constraints(withVisualFormat: "H:|[mapView]|", options: [], metrics: nil, views: views)

            NSLayoutConstraint.activate(vertical + horizontal)

            autoreleasepool {
                mapView.startMonitoringLocation()
                mapView.backToMyPosition()
            }
        }
    }

The screen opens up and about 1 second in that screen the crash appears. (I can even see the blue dot in the middle of the map but the map is all grey...)

I even tried enabling Zombie to try to catch whats is causing this but not much of help there too... here is the screenshot:

crash screenshot

Does anyone know what might be causing this crash?

Thanks in advance!


Viewing all articles
Browse latest Browse all 7188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>