benjamindean / flutter_vibration

Handle vibration on iOS and Android in Flutter apps
219 stars 68 forks source link

Thread 1: EXC_BAD_ACCESS Error when debug #9

Closed Amasian closed 3 years ago

Amasian commented 5 years ago

I am checking whether this plugin works in ios. so I wrote really simple flutter like following:

import 'package:vibration/vibration.dart';

//...

void _vibrate() {
     Vibration.vibrate();
  }

//  ...

@override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(

          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'vibration test',
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: ()=> _vibrate(),
        tooltip: 'vibrate',
        child: Icon(Icons.vibration),
      ), 
    );
  }

when I debug it in Xcode, I got following result in VibrationPlugin.m: Thread 1: EXC_BAD_ACCESS (code=2, address=0x16b627fe0) and several [VibrationPlugin registerWithRegistrar:registrar] object on the left window.

Does somebody know what is the reason of it? After spending long time of research I guess it could be stack overflow problem. but I don't know why it occurs.

benjamindean commented 4 years ago

Sorry for the delay. I'll investigate it as soon as I can.

benjamindean commented 3 years ago

I managed to reproduce it at one point, but it's not happening anymore. Please, let me know if it still happens.