Coder Social home page Coder Social logo

Comments (9)

kvs-coder avatar kvs-coder commented on July 17, 2024 1

Hi all,

does it happen now in the 2.1.0 version? Unfortunately I don't have any iOS 12 device by hand.
I assume the problem was here

The availability macro was in the wrong place

from health_kit_reporter.

lynrin avatar lynrin commented on July 17, 2024 1

If you add it directly with Xcode, it will be reset every time you start it via Flutter, so I added the following to the project's ios/Podfile to make a temporary workaround.

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      flutter_additional_ios_build_settings(target)
+
+     if target.name == 'HealthKitReporter'
+       # Add HealthKit.framework with Weak attribute.
+       ref_healthkit = target.project.frameworks_group.new_reference('HealthKit.framework')
+       ref_healthkit.source_tree = 'SDKROOT'
+
+       ref_build_phases_healthkit = target.frameworks_build_phases.add_file_reference(ref_healthkit)
+       ref_build_phases_healthkit.settings = { 'ATTRIBUTES' => ['Weak'] }
+     end
    end
  end

from health_kit_reporter.

kvs-coder avatar kvs-coder commented on July 17, 2024

Hi @thachnn2

Thank you for your report. According to Apple documentation you must have iOS 14 minimum to use Electrocardiogram related API. Source. Also see in the consumed library

In the example app you might locally comment out the lines 107 and 108 of main.dart file and give it a try again.

from health_kit_reporter.

mariosemedo avatar mariosemedo commented on July 17, 2024

Hi @VictorKachalov

I'm also experiencing this issue with iPhone 5S iOS 12.4. The app crashes in release mode and is frozen in debug.

from health_kit_reporter.

mariosemedo avatar mariosemedo commented on July 17, 2024

Hi @thachnn2,

I was able to get this working by downgrading the Command Line tools to Xcode 13.2.1.

Screenshot 2022-04-08 at 16 54 16

Find out how to downgrade here.

@VictorKachalov This doesn't fix the issue. It would be good to know why this is happening in the latest version of Xcode.

from health_kit_reporter.

nohli avatar nohli commented on July 17, 2024

I have the same issue.
The app is only saving to mindful minutes, and a lot of iOS 12 devices are crashing right at the app start.

from health_kit_reporter.

mariosemedo avatar mariosemedo commented on July 17, 2024

Hi @thachnn2,

I was able to get this working by downgrading the Command Line tools to Xcode 13.2.1.

Screenshot 2022-04-08 at 16 54 16

Find out how to downgrade here.

@VictorKachalov This doesn't fix the issue. It would be good to know why this is happening in the latest version of Xcode.

This no longer works. @VictorKachalov Any updates on when this will be fixed?

from health_kit_reporter.

kvs-coder avatar kvs-coder commented on July 17, 2024

@mariosemedo

Does it also happen for you, if you use the native lib https://github.com/VictorKachalov/HealthKitReporter ?

from health_kit_reporter.

lynrin avatar lynrin commented on July 17, 2024

Hi @VictorKachalov

Even if health_kit_reporter was set to 2.1.0, an error occurred at runtime and it could not be started. (iOS 12.4.1)

dyld: Symbol not found: _OBJC_CLASS_$_HKElectrocardiogramQuery
  Referenced from: /private/var/containers/Bundle/Application/0B2AD4DC-AEA1-4EFB-B075-4177D73FA04D/Runner.app/Frameworks/HealthKitReporter.framework/HealthKitReporter
  Expected in: /System/Library/Frameworks/HealthKit.framework/HealthKit
 in /private/var/containers/Bundle/Application/0B2AD4DC-AEA1-4EFB-B075-4177D73FA04D/Runner.app/Frameworks/HealthKitReporter.framework/HealthKitReporter

In the main project, HealthKit.framework is linked as Optional, but when I added HealthKit.framework as Optional to HealthKitReporter on the Pods side, I was able to start it even on "iOS 12.4.1".
(In this case, you can also remove the link to HealthKit.framework from the main project.)

Can't it be solved by adding the following to HealthKitReporter.podspec of HealthKitReporter?

spec.weak_frameworks = 'HealthKit'

from health_kit_reporter.

Related Issues (20)

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.