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

'UnsafeRawBufferPointer' is not convertible to 'UnsafePointer<_>' #920

Closed
Viswanth92 opened this issue Apr 26, 2019 · 3 comments · Fixed by #1034
Closed

'UnsafeRawBufferPointer' is not convertible to 'UnsafePointer<_>' #920

Viswanth92 opened this issue Apr 26, 2019 · 3 comments · Fixed by #1034

Comments

@Viswanth92
Copy link

@Viswanth92 Viswanth92 commented Apr 26, 2019

I used this integration to report this error.

use xcode 10.1 ,swift 4.2

I tried pod version 0.11.6 and the issue still exists. I do not want to update my Xcode yet due to other SDKs that I am using my project.

@aniiskywalker
Copy link

@aniiskywalker aniiskywalker commented May 2, 2019

hello @Viswanth92, I had to downgrade my Xcode as well, and I faced the same problem, what I did was install Sqlite manually (download version 0.11.5 and copy xcproject to your project) as said in the README and it works for me, hope it helps.

If you have any questions about it you can @'me hehe

@bdorfman
Copy link

@bdorfman bdorfman commented May 20, 2019

Having the same issue, it seems that 0.11.6+ should be marked as "Swift 5 Required" and not "Swift 5 Supported"

It seems like possibly replacing the implementation of datatypeValue in Foundation.swift with the following could be a possible solution to continue supporting both versions but I am unclear how safe this change actually is.

        #if swift(>=5.0)
        return withUnsafeBytes { (pointer: UnsafeRawBufferPointer) -> Blob in
            return Blob(bytes: pointer.baseAddress!, length: count)
        }
        #else
        return withUnsafeBytes { (pointer: UnsafePointer<UInt8>) -> Blob in
            return Blob(bytes: pointer, length: count)
        }
        #endif
    }

If you make this change and also change SWIFT_VERSION to 4.2, all the tests seem to pass on Xcode 10.1 at least

@JasonLiu1989
Copy link

@JasonLiu1989 JasonLiu1989 commented Dec 5, 2019

try this
add these code into your podfile

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.2'
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end

and set

pod 'SQLite.swift', '0.11.5'

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

Successfully merging a pull request may close this issue.

4 participants