Caldarie / flutter_tflite_audio

Audio classification Tflite package for flutter (iOS & Android). Can support Google Teachable Machine models
MIT License
63 stars 24 forks source link

iOS issues: Invalid 'tflite_audio.podspec' file after change plugin version and problems with flutter 2 #9

Closed cmalbuquerque closed 3 years ago

cmalbuquerque commented 3 years ago

I noted that using a new version of this plugin, there are some problems specially in iOS devices:

  1. Using the next dependency and running pod install, it fails:
dependencies:
  tflite_audio: ^0.1.6+1
Analyzing dependencies
[!] Failed to load 'tflite_audio' podspec: 
[!] Invalid `tflite_audio.podspec` file: syntax error, unexpected tCONSTANT, expecting end
  s.summary          = 'A new flutter plugin project.'
                        ^
/Users/carolinaalbuquerque/Documents/beingcare-concept-proof/concept_proof/ios/.symlinks/plugins/tflite_audio/ios/tflite_audio.podspec:8: syntax error, unexpected tSTRING_BEG
...'A new flutter plugin project.'
...                              ^
/Users/carolinaalbuquerque/Documents/beingcare-concept-proof/concept_proof/ios/.symlinks/plugins/tflite_audio/ios/tflite_audio.podspec:12: syntax error, unexpected tIDENTIFIER, expecting end-of-input
  s.homepage         = 'http://example.com'
                        ^~~~.

 #  from /Users/carolinaalbuquerque/Documents/beingcare-concept-proof/concept_proof/ios/.symlinks/plugins/tflite_audio/ios/tflite_audio.podspec:8
 #  -------------------------------------------
 #    s.version          = '0.1.6+1
 >    s.summary          = 'A new flutter plugin project.'
 #    s.description      = <<-DESC
 #  -------------------------------------------

However, using the version 0.1.5+3, this issue not happens!

  1. Also, after flutter update to flutter 2, I started to have some problems in startRecording process when running using an iPhone:
Launching lib/main.dart on iPhone de Carolina in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: 5SSNTW7HP4
Running pod install...                                              6,4s
Running Xcode build...                                                  
 └─Compiling, linking and signing...                        18,5s
Xcode build done.                                           43,6s
Initialized TensorFlow Lite runtime.                                    
Created TensorFlow Lite delegate for select TF ops.                     
TfLiteFlexDelegate delegate: 3 nodes delegated out of 47 nodes with 2 partitions.
["0 Background Noise", "1 Clap", "2 Whistle"]                           
Installing and launching...                                        42,9s
Connecting to the VM Service is taking longer than expected...
Permission granted
start microphone
Permission granted
start microphone
[avae]            AVAEInternal.h:76    required condition is false: [AVAEGraphNode.mm:817:CreateRecordingTap: (nullptr == Tap())]
*** Terminating app due to uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required condition is false: nullptr == Tap()'
*** First throw call stack:
(0x1ad19a9d8 0x1c1520b54 0x1ad0a950c 0x1bd103984 0x1bd161c04 0x1bd149b3c 0x1bd1c6de8 0x1bd1a81e4 0x105aaaf80 0x105aa83d4 0x105aa7a30 0x105aa7bcc 0x10d2e45bc 0x10ca83b78 0x10cd82f5c 0x10cd2235c 0x10cd24a14 0x1ad11b3e0 0x1ad11afe4 0x1ad11a4c4 0x1ad114850 0x1ad113ba0 0x1c3e7c598 0x1afa052f4 0x1afa0a874 0x10578877c 0x1acdf2568)
libc++abi.dylib: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001d90d984c libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1d90d984c <+8>:  b.lo   0x1d90d9868               ; <+36>
    0x1d90d9850 <+12>: stp    x29, x30, [sp, #-0x10]!
    0x1d90d9854 <+16>: mov    x29, sp
    0x1d90d9858 <+20>: bl     0x1d90b6f5c               ; cerror_nocancel
Target 0: (Runner) stopped.
Still attempting to connect to the VM Service...
If you do NOT see the Flutter application running, it might have crashed. The device logs (e.g. from adb or XCode) might have more details.

Besides this, when running in Android device, it works perfectly both for v0.1.5+3 and v0.1.6+1!

Caldarie commented 3 years ago

Hi @cmalbuquerque

Many thanks for pointing the bugs out.

  1. For the podsec issue, it seems like I’ve forgotten to add an apostrophe after 0.1.6+1 . I’ll have this hot fixed very soon.
  2. As for flutter 2.0.0, to be honest I wasn’t aware that this was released just recently. I’ll definitely take a look and see if I can provide a hot fix as well.
Caldarie commented 3 years ago

Hi @cmalbuquerque

Ive updated the package to 0.1.6+2. Let me know if you still recieve the same error.

Michael

cmalbuquerque commented 3 years ago

@Caldarie yes, it works both on Android and iOS already using Flutter 2! 😁

Many thanks for the update!