validateNewTexture: 89: сбой утверждения `BytesPerRow текстуры с буферной поддержкой - PullRequest
2 голосов
/ 21 сентября 2019

У меня есть два контроллера представления, представленные как модалы.Один показывает Google Maps и возвращает выбранное местоположение с помощью функции «развернуть», а второй просто показывает карту.

Сбой, когда я отклоняю модальный ВК на 8.4 устройства, работающего под управлением 12.4.1.Исключением является следующее.

validateNewTexture: 89: сбой утверждения `BytesPerRow текстуры с буферной поддержкой с pixelFormat (MTLPixelFormatBGRA8Unorm) должен быть выровнен до 64 байтов, найдено bytesPerRow (4976)

Оба вышеперечисленных прекрасно работают в симуляторе 8 Plus, на устройстве iPhone 6 и iOS 12.4.1.Также работает на симуляторе iOS 13.

Это исключение происходит в моем исходном коде VC ниже.Сбой произошел в строке DispatchQueue.

override func viewWillAppear(_ animated: Bool) {

        // to ensure the scroll view starts below navigation bar.
        if #available(iOS 11.0, *) {
            self.scrollView.contentInsetAdjustmentBehavior = .automatic
        } else {
            self.automaticallyAdjustsScrollViewInsets = false
        }

    }
    override func viewDidAppear(_ animated: Bool) {

        super.viewDidAppear(true)

       let spinner = CommonHelper.showActivityIndicatorAndStopInteraction(self.view, style: UIActivityIndicatorView.Style.gray)

        DispatchQueue.main.async {

                PFUser.current()?.fetchInBackground(block: { (user, error) in

                    CommonHelper.hideActivityIndicatorAndStartInteraction(spinner)


    }
}

Проект установлен для Swift 5 и цель развертывания iOS 12.

Сегодня я обновился до XCode 11.

я не менял код с одного года !!Пробовал чистую папку, перезапуск Xcode тоже но безуспешно.

Код одного виртуального контейнера, который показывает карту и трассировку стека, приведен ниже.

class MapViewController: UIViewController {

    @IBOutlet weak var mapView: GMSMapView!

    @IBOutlet weak var selectedAddress: UILabel!
    var userLattitude: Double = 0
    var userLongitude: Double = 0
    var selectedCoordinate: CLLocation?
    var selectedCity: String?
    var selectedname: String?

    // to be used on unwind to restore values
    var userAddress = ""

    let locationManager = CLLocationManager()

    @IBOutlet weak var selectAddress: UIBarButtonItem!

    @IBOutlet weak var chooseAddressButton: UIButton!

    @IBAction func cancel(_ sender: AnyObject) {

        dismiss(animated: true, completion: nil)

    }


 override func shouldPerformSegue(withIdentifier identifier: String?, sender: Any!) -> Bool {


        if identifier == "unwindLocation" || identifier == "unwindLocationSelection" ||  identifier == "backtoprofile" {

            return true

        } else {

            return false
        }

    }



    override func viewDidLoad() {
        super.viewDidLoad()

        chooseAddressButton.layer.borderColor = UIColor.flatMint().cgColor
        chooseAddressButton.layer.cornerRadius = 5
        chooseAddressButton.layer.borderWidth = 1



    }

    override func viewDidAppear(_ animated: Bool) {

        locationManager.delegate = self
        locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
        locationManager.distanceFilter = 50
        locationManager.requestWhenInUseAuthorization()

        mapView.delegate = self
        if selectedCoordinate != nil {

            logger.debug("selectedCoordinate \((self.selectedCoordinate?.coordinate.latitude)!) : \((self.selectedCoordinate?.coordinate.longitude)!)")

            mapView.isMyLocationEnabled = true



            // user had a location selected so display

            locationManager.stopUpdatingLocation()
            //locationManager.stopMonitoringSignificantLocationChanges()

            mapView.camera = GMSCameraPosition(target: selectedCoordinate!.coordinate, zoom: 17, bearing: 0, viewingAngle: 0)

        }

    }

func reverseGeocodeCoordinate(_ coordinate: CLLocationCoordinate2D) {

        let geocoder = GMSGeocoder()
        self.selectedCoordinate = CLLocation(latitude: coordinate.latitude, longitude: coordinate.longitude)

        geocoder.reverseGeocodeCoordinate(coordinate) { response, error in

            if let address = response?.firstResult() {

                let lines = address.lines! as [String]

                self.selectedAddress.text = lines[0]
                self.selectedCity = address.locality

            }
        }
    }

}


extension MapViewController: CLLocationManagerDelegate {


    func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {

        if status == .authorizedWhenInUse {

            mapView.isMyLocationEnabled = true
            mapView.settings.myLocationButton = true

            if selectedCoordinate != nil {

                // locationManager.stopMonitoringSignificantLocationChanges()
                locationManager.stopUpdatingLocation()

                mapView.camera = GMSCameraPosition(target: selectedCoordinate!.coordinate, zoom: 17, bearing: 0, viewingAngle: 0)
            } else {

                locationManager.startUpdatingLocation()

            }



        }
    }

    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {

        if selectedCoordinate != nil {


            locationManager.stopMonitoringSignificantLocationChanges()

            mapView.camera = GMSCameraPosition(target: selectedCoordinate!.coordinate, zoom: 17, bearing: 0, viewingAngle: 0)

        } else if let location = locations.first {


            mapView.camera = GMSCameraPosition(target: location.coordinate, zoom: 17, bearing: 0, viewingAngle: 0)

            locationManager.stopMonitoringSignificantLocationChanges()
        }

    }

}

extension MapViewController: GMSMapViewDelegate {

    func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {

        reverseGeocodeCoordinate(position.target)

    }

 }

Трассировка стека указана ниже

- 0 : "0   ???                                 0x000000010d5d8a0c 0x0 + 4519201292"
  - 1 : "1   Lendable                            0x000000010101c1bc main + 0"
  - 2 : "2   libsystem_c.dylib                   0x00000001b0cabea8 abort + 140"
  - 3 : "3   libsystem_c.dylib                   0x00000001b0c79afc __assert_rtn + 220"
  - 4 : "4   Metal                               0x00000001b32ee134 MTLReportFailure + 500"
  - 5 : "5   MetalTools                          0x00000001d67a933c <redacted> + 1184"
  - 6 : "6   MetalTools                          0x00000001d67a8bb0 <redacted> + 256"
  - 7 : "7   AppleMetalGLRenderer                0x00000001d19267b4 <redacted> + 312"
  - 8 : "8   AppleMetalGLRenderer                0x00000001d19357d0 gldFlushObject + 96"
  - 9 : "9   GLEngine                            0x00000001d2813584 <redacted> + 392"
  - 10 : "10  GLEngine                            0x00000001d27933cc <redacted> + 496"
  - 11 : "11  GLEngine                            0x00000001d2842e28 gliBindViewES + 308"
  - 12 : "12  OpenGLES                            0x00000001b43c19ac <redacted> + 500"
  - 13 : "13  MyApp                            0x000000010125fec4 _ZN7gmscore8renderer3ios19GLLayerRenderTarget17DeleteFramebufferEv + 164"
  - 14 : "14  MyApp                            0x000000010125ff3c _ZN7gmscore8renderer3ios19GLLayerRenderTarget20DidStopUsingResourceEv + 20"
  - 15 : "15  MyApp                            0x00000001012f5f58 __30-[GMSPhoenixRenderer tearDown]_block_invoke + 112"
  - 16 : "16  Foundation                          0x00000001b1b49ec0 <redacted> + 972"
  - 17 : "17  Foundation                          0x00000001b1b4bcf0 <redacted> + 128"
  - 18 : "18  MyApp                            0x00000001012f5ec4 -[GMSPhoenixRenderer tearDown] + 116"
  - 19 : "19  MyApp                            0x00000001012d7488 -[GMSEntityRendererView tearDownRenderer] + 116"
  - 20 : "20  MyApp                            0x00000001012d601c -[GMSEntityRendererView dealloc] + 64"
  - 21 : "21  MyApp                            0x0000000101326978 -[GMSVectorMapView dealloc] + 316"
  - 22 : "22  MyApp                            0x000000010107fa30 -[GMSMapView .cxx_destruct] + 692"
  - 23 : "23  libobjc.A.dylib                     0x00000001b038e7cc <redacted> + 148"
  - 24 : "24  libobjc.A.dylib                     0x00000001b039e6b8 objc_destructInstance + 68"
  - 25 : "25  libobjc.A.dylib                     0x00000001b039e720 object_dispose + 16"
  - 26 : "26  UIKitCore                           0x00000001ddc71de8 <redacted> + 152"
  - 27 : "27  UIKitCore                           0x00000001de0b2c64 <redacted> + 984"
  - 28 : "28  MyApp                            0x00000001010788f8 -[GMSMapView dealloc] + 264"
  - 29 : "29  libobjc.A.dylib                     0x00000001b03a9b9c <redacted> + 672"
  - 30 : "30  CoreFoundation                      0x00000001b11c43b0 _CFAutoreleasePoolPop + 28"
  - 31 : "31  UIKitCore                           0x00000001ddc4188c <redacted> + 132"
  - 32 : "32  UIKitCore                           0x00000001ddc6eac4 <redacted> + 204"
  - 33 : "33  CoreFoundation                      0x00000001b1147d08 <redacted> + 32"
  - 34 : "34  CoreFoundation                      0x00000001b1142a30 <redacted> + 412"
  - 35 : "35  CoreFoundation                      0x00000001b1142fac <redacted> + 1228"
  - 36 : "36  CoreFoundation                      0x00000001b11427c0 CFRunLoopRunSpecific + 436"
  - 37 : "37  GraphicsServices                    0x00000001b334379c GSEventRunModal + 104"
  - 38 : "38  UIKitCore                           0x00000001ddc47c38 UIApplicationMain + 212"
  - 39 : "39  MyApp                            0x000000010101c208 main + 76"
  - 40 : "40  libdyld.dylib                       0x00000001b0c068e0 <redacted> + 4"

1 Ответ

1 голос
/ 22 сентября 2019

Я обнаружил, что эта проблема также сообщается в структуре, которой я не пользуюсь, но она сработала для меня, поэтому пометка этого вопроса ответила, хотя это выглядит как обходной путь.Я не нашел много об этой ошибке в Интернете.

https://github.com/KhronosGroup/MoltenVK/issues/341#issuecomment-439286244

У меня уже был отключен захват кадров GPU и отключена проверка API-интерфейса Metal, так как я не использую Metal APi в своемпроект.

Я не отключил исполняемый файл отладки в разделе Схема -> Выполнить -> Информация, так как он может быть общим и может потребоваться.Я не знаю, как это используется:)

Надеюсь, это поможет кому-то еще.

Спасибо, Ашиш

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...