I got this error when tried to generate iOS In iOS on 2021-02-18 at 13:22:57 - Error compiling Cordova plugin: /var/lib/builder01/builds/4146d25b-275f-40a8-9f82-316cff814a83/source/platforms/ios/iCansa/Plugins/cordova-plugin-tts/CDVTTS.m. But its working fine on android
Hi Abdiel,
When you try to generate in IOS with MABS 6.3/7.0 there are 4 errors:
[VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:64:19: error: redefinition of 'options' [VERBOSE] [Build] NSDictionary* options = [command.arguments objectAtIndex:0]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:40:19: note: previous definition is here [VERBOSE] [Build] NSDictionary* options = [command.arguments objectAtIndex:0]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:66:15: error: redefinition of 'text' [VERBOSE] [Build] NSString* text = [options objectForKey:@"text"]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:42:15: note: previous definition is here [VERBOSE] [Build] NSString* text = [options objectForKey:@"text"]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:67:15: error: redefinition of 'locale' [VERBOSE] [Build] NSString* locale = [options objectForKey:@"locale"]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:43:15: note [VERBOSE] [Build] : previous definition is here [VERBOSE] [Build] NSString* locale = [options objectForKey:@"locale"]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:68:12: error: redefinition of 'rate' [VERBOSE] [Build] double rate = [[options objectForKey:@"rate"] doubleValue]; [VERBOSE] [Build] ^ [VERBOSE] [Build] /var/lib/builder02/builds/58ed0d18-7a43-47c2-95a9-b7683540f752/source/platforms/ios/TextToSpeechDemo/Plugins/cordova-plugin-tts/CDVTTS.m:44: [VERBOSE] [Build] 12: note: [VERBOSE] [Build] previous definition is here [VERBOSE] [Build] double rate = [[options objectForKey:@"rate"] doubleValue]; [VERBOSE] [Build] ^ [VERBOSE] [Build] 4 errors generated.
This plugin uses https://github.com/LuisMAlmeida/cordova-plugin-tts (version forked from https://github.com/vilic/cordova-plugin-tts). These versions in the IOS source (src/ios/CDVTTS.m) have a redefinition of variables problem that does not allow to compile in IOS.
Options
The best option is 1 but perhaps the team of this plugin can give you more information.
Kind regards, David.
Hi David and Abdiel,
As we had Abdiel in on of our Slack channels we touched base with him there and completely forgot to post the answer here too. We needed this version of the plugin for a project with a strict deadline so we rushed through it a bit, as for this project Android sufficed we focused mainly on that and didn't check iOS.However now that that project is done we have the time and availability to make some fixes and make it work for Android, iOS and PWA
It's great news so. :-)
Just updated the Plugin following your recommendations David, I don't have an iPhone handy yet so I won't be able to properly test it, unfortunately.