0

I have a rust project. Compiling it to .so for android, I'm able to run it with Android. I have also generated .a file for iOS and used instructions for this answer but it's throwing following error: Semantic Issue (Xcode): Use of undeclared identifier 'LibStackmatePlugin' /Users/mohitsingh/Desktop/myapp/ios/Runner/GeneratedPluginRegistrant.m:17:3.

GeneratedPluginRegistrant.m is as follows:

//
//  Generated file. Do not edit.
//

// clang-format off

#import "GeneratedPluginRegistrant.h"

#if __has_include(<libstackmate/LibStackmatePlugin.h>)
#import <libstackmate/LibStackmatePlugin.h>
#else
@import libstackmate;
#endif

@implementation GeneratedPluginRegistrant

+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
  [LibStackmatePlugin registerWithRegistrar:[registry registrarForPlugin:@"LibStackmatePlugin"]];
}

@end

Is there something else that needs to be done?

Mohit Singh
  • 323
  • 4
  • 13
  • Please update the question showing the contents of `/Users/mohitsingh/Desktop/myapp/ios/Runner/GeneratedPluginRegistrant.m` – Richard Heap Sep 06 '22 at 16:05
  • @RichardHeap, updated the question with ```/Users/mohitsingh/Desktop/myapp/ios/Runner/GeneratedPluginRegistrant.m```. The .a file is named ```libstackmate.a```. – Mohit Singh Sep 06 '22 at 17:14

1 Answers1

0

The problem was with my pubspec.yaml file. It defined plugin as

      android:
        package: com.example.libstackmate
        pluginClass: LibstackmatePlugin
      ios:
        pluginClass: LibstackmatePlugin

but in ios/app, plugin was defined as LibStackmatePlugin. Due to this name mismatch, I was getting this error. The error was resolved by updating ios pluginClass name in pubspec.yaml.

Mohit Singh
  • 323
  • 4
  • 13