Skip to content

Support Android 23 #374

@madsodgaard

Description

@madsodgaard

swift-log does not currently compile for Android 23, but only Android 24+.

This is due to the following code:

#if canImport(WASILibc) || os(Android)
internal typealias CFilePointer = OpaquePointer
#else
internal typealias CFilePointer = UnsafeMutablePointer<FILE>
#endif

On Android 23 a file pointer is actually UnsafeMutablePointer<FILE> and not OpaquePointer, unlike newer API versions.

We are working on adding support for Android version availability checks, but until that is officially merged and released, we cannot use swift-log or any dependencies which use it, which is quite unfortunate.

@ktoso and I discussed that removing the default file logger for Android could be a solution. "Technically" android is just best effort supported right now, so you could argue that this is fine.

Also, Android developers would probably bring their own logger implementation, which uses <android/log.h>, instead of just using to stdout, since by default, the Android system sends stdout and stderr output to /dev/null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform/androidAndroid platform specific issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions