Coder Social home page Coder Social logo

google-mlkit-swiftpm's Introduction

Google MLKit SwiftPM Wrapper

This is experimental project for building MLKit in Swift Package Manager.

Requirements

  • iOS 14 and later
  • Xcode 13.2.1 and later

Installation

Use Swift Package Manager to install

    .package(url: "https://github.com/d-date/google-mlkit-swiftpm", from: "5.0.0")

Add Linker flags

Add these flags to Other Linker Flags in Build Settings of your Xcode projects.

  • -ObjC
  • -all_load

Link .bundle to your project

The MLKitFaceDetection contains GoogleMVFaceDetectorResources.bundle. Since the bundle can't be introduced via Swift PM, you need to link to your project by yourself.

Download GoogleMVFaceDetectorResources.bundle from Release and add to your Xcode project and make it available in your build target.

Limitation

  • Since pre-built MLKit binary missing arm64 for iphonesimulator, this project enables to build in arm64 for iphoneos and x86_64 for iphonesimulator only.
  • Only supported Face Detection and Barcode Scanning right now.

Example

Open Example/Example.xcworkspace and fixing code signing to yours.

google-mlkit-swiftpm's People

Contributors

d-date avatar diplay avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

google-mlkit-swiftpm's Issues

macOs support

Not sure if it's possible. But any chance you can add macOs arm64/x86_64 support?

Missing signature for GoogleToolboxForMac.framework

ITMS-91065: Missing signature - Your app includes “Frameworks/GoogleToolboxForMac.framework/GoogleToolboxForMac”, which includes GoogleToolboxForMac, an SDK that was identified in the documentation as a privacy-impacting third-party SDK. If a new app includes a privacy-impacting SDK, or an app update adds a new privacy-impacting SDK, the SDK must include a signature file. Please contact the provider of the SDK that includes this file to get an updated SDK version with a signature. For details about verifying the code signature for a third-party SDK, visit: https://developer.apple.com/documentation/xcode/verifying-the-origin-of-your-xcframeworks.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

bundler
Gemfile
cocoapods
Podfile
  • GoogleMLKit/FaceDetection ~> 6.0.0
  • GoogleMLKit/BarcodeScanning ~> 6.0.0
swift
Example/Package/Package.swift
  • firebase/firebase-ios-sdk from: "10.0.0"
Package.swift
  • google/promises 2.4.0
  • google/GoogleDataTransport 9.4.0
  • google/GoogleUtilities 7.13.2
  • google/gtm-session-fetcher 3.4.1
  • firebase/nanopb 2.30910.0

  • Check this box to trigger a request for Renovate to run again on this repository

add Firebase?

They share a lot of dependencies,
Currently, we are using both Firebase and GoogleMLKit. it would be difficult without Firebase support here

Do you have any ideas?

MLKit has crashed with missing MLKITx_CCTClearcutUploader

Due to lack of internal selector MLKITx_CCTClearcutUploader, the app has crash with runtime error as below.

2022-10-09 14:01:16.963 Example[55121/0x16daff000] [lvl=3] +[MLKITx_CCTClearcutUploader crashIfNecessary] Multiple instances of CCTClearcutUploader were instantiated. Multiple uploaders function correctly but have an adverse affect on battery performance due to lock contention.
2022-10-09 14:01:16.965219+0900 Example[55121:11997752] +[MLKITx_GMVUtility resourceSearchPaths:bundleName:]: unrecognized selector sent to class 0x103e78160
2022-10-09 14:01:16.969 Example[55121/0x16daff000] [lvl=3] +[MLKITx_CCTClearcutUploader crashIfNecessary] Multiple instances of CCTClearcutUploader were instantiated. Multiple uploaders function correctly but have an adverse affect on battery performance due to lock contention.
2022-10-09 14:01:16.969161+0900 Example[55121:11997752] +[MLKITx_GMVUtility resourceSearchPaths:bundleName:]: unrecognized selector sent to class 0x103e78160
2022-10-09 14:01:16.981413+0900 Example[55121:11997758] -[MLKITx_CCTClearcutLogger logCounters:]: unrecognized selector sent to instance 0x2838f1bd0
2022-10-09 14:01:16.981631+0900 Example[55121:11997758] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MLKITx_CCTClearcutLogger logCounters:]: unrecognized selector sent to instance 0x2838f1bd0'
*** First throw call stack:
(0x1b09f6248 0x1a9db7a68 0x1b0b6a3f0 0x1b0a0c360 0x1b0a74660 0x102cb938c 0x102cdae14 0x104f8e04c 0x104f9fe00 0x104f9f5d0 0x102cdad78 0x102cba848 0x102cb5f20 0x102cb2bf8 0x104f8c598 0x104f8e04c 0x104f960fc 0x104f96e24 0x104fa3cac 0x1fd314df8 0x1fd314b98)
libc++abi: terminating with uncaught exception of type NSException

This is only caused in Swift PM, not CocoaPods official. It seems to be missed some internal APIs official MLKit used.

PoseDetectionAccurate

I'm using PoseDetectionAccurate in my project. Could add the PoseDetectionAccurate bundle, or is there a workaround I can use to do it myself?

Building with `swift build`

I can't use Xcode because I want to use this project with Rust (so I need to build from a script), is there a way to build using swift build? I've been trying $ swift build -Xswiftc -sdk -Xswiftc /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -Xswiftc -target -Xswiftc arm64-apple-ios13.0 -Xlinker -ObjC -Xlinker -all_load but I keep getting this error:

google-mlkit-swiftpm/Sources/Common/export.swift:1:19: error: no such module 'MLKitCommon'
@_exported import MLKitCommon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.