2

I am trying to run following program:

void main() {
 runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
    home: VoiceApp(key: Key('key'), title: 'MyVoice app'),
  );
 }
}

class VoiceApp extends StatefulWidget {
  const VoiceApp({super.key, required this.title});
  final String title;

  @override
  State<VoiceApp> createState() => VoiceAppState();
}

class VoiceAppState extends State<VoiceApp> {
  String? name;
  final recorder = Record();

  startRecording() async {
  final record = Record();

  // Check and request permission
  if (await record.hasPermission()) {
    // Start recording
    await record.start(
      path: 'aFullPath/myFile.m4a',
      encoder: AudioEncoder.aacLc, // by default
      bitRate: 128000, // by default
      samplingRate: 44100, // by default
    );
   }
 }

 @override
 Widget build(BuildContext context) {
    return Scaffold(
     body: Column(children: [
       ElevatedButton(
       onPressed: startRecording(),
       child: const Text('Start'),
      )
    ]));
  }
}

Running the above generates following debug message:

 Launching lib/main.dart on macOS in debug mode...
 CocoaPods' output:
  Preparing
  Analyzing dependencies
  Inspecting targets to integrate Using `ARCHS` setting to build architectures 
  of target `Pods-Runner`: (``)
   Finding Podfile changes
   A record_macos
   R path_provider_foundation
   - FlutterMacOS
  Fetching external sources
   -> Fetching podspec for `FlutterMacOS` from `Flutter/ephemeral`
   -> Fetching podspec for `record_macos` from 
 `Flutter/ephemeral/.symlinks/plugins/record_macos/macos`
  Resolving dependencies of `Podfile`
  CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local 
 because checking is only performed in repo update
  [!] CocoaPods could not find compatible versions for pod "record_macos":
  In Podfile:
    record_macos (from `Flutter/ephemeral/.symlinks/plugins/record_macos/macos`)
  Specs satisfying the `record_macos (from 
`Flutter/ephemeral/.symlinks/plugins/record_macos/macos`)` dependency were 
 found, but they required a higher minimum deployment target.
  /Library/Ruby/Gems/2.6.0/gems/molinillo- 
 0.8.0/lib/molinillo/resolution.rb:317:in `raise_error_unless_state'
  /Library/Ruby/Gems/2.6.0/gems/molinillo- 
 0.8.0/lib/molinillo/resolution.rb:299:in `block in unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:297:in 
`tap'  /Library/Ruby/Gems/2.6.0/gems/molinillo- 
 0.8.0/lib/molinillo/resolution.rb:297:in `unwind_for_conflict'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:682:in 
`attempt_to_activate'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:254:in 
`process_topmost_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolution.rb:182:in 
`resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in 
`resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/resolver.rb:94:in 
`resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods- 
 1.11.3/lib/cocoapods/installer/analyzer.rb:1078:in `block in 
resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods- 
1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods- 
1.11.3/lib/cocoapods/installer/analyzer.rb:1076:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods- 

1.11.3/lib/cocoapods/installer/analyzer.rb:124:in analyze' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in analyze' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in block in resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods- 1.11.3/lib/cocoapods/user_interface.rb:64:in section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in resolve_dependencies' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods- 1.11.3/lib/cocoapods/command/install.rb:52:in run' /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:in load' /usr/local/bin/pod:23:in `' Exception: Error running pod install Exited

Environment: Mac OS Monterey 12.6.3 Flutter (Channel stable, 3.7.3, on macOS 12.6.3 21G419 darwin-x64, locale en-US) Flutter doctor No Issues Found

1
  • 1
    found any solutions? Commented Mar 11, 2023 at 16:23

1 Answer 1

2

edit macos/Podfile: platform :osx, '10.15'

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.