GetMetaMap / metamap-flutter-plugin

Flutter plugin for Mati SDK
MIT License
2 stars 8 forks source link

Falha ao compilar no IOS #12

Closed brasizza closed 2 years ago

brasizza commented 2 years ago

Estou recebendo esta mensagem ao compilar para o IOS

/Users/marcusbrasizza/development/flutter/.pub-cache/git/mati-flutter-plugin-de7e788b8110947a32a4cdf33ca9ed66b2c7f7ab/ios/Classes/SwiftMatiPluginFlutterPlugin.swift:3:8: error: no such module 'MatiSDK' import MatiSDK

estou tanto usando o git direto quanto o que esta no pub.dev poderiam me ajudar ? estou usando

`marcusbrasizza@MacBook-Pro-de-Marcus-2 ios % flutter doctor -v [✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale pt)

• Flutter version 2.8.1 at /Users/marcusbrasizza/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (8 days ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1`
AvoSukiasyan commented 2 years ago

Hi @brasizza . can say which our flutter plugin version do you use please ? and also please info about iOS pod version

brasizza commented 2 years ago

Hi @brasizza . can say which our flutter plugin version do you use please ? and also please info about iOS pod version

Sorry about write in PT , i tought that the package was from here.

Well i´m using the M1 apple and my cocapod is in 1.11.2 I put my PodFile in ios 12 and my xcode in Ios12

In podfile i put this

mati_plugin_flutter: git: https://github.com/GetMati/mati-flutter-plugin.git or mati_plugin_flutter: ^2.4.9 (latest version avaliable)

and didn´t work as well.

then i deleted my podfile.lock and did the pod install again

the ios installed the version: mati_plugin_flutter (2.2.1)

and then i got this error when i tried to build.

https://drive.google.com/file/d/10Fy7XLsSA1uBaC2nMTtgnGPxMmebvBOk/view?usp=sharing

AvoSukiasyan commented 2 years ago

@brasizza The plugin integration not right. You use methodChannel but it's not need. for integration please use this

import 'package:flutter/material.dart'; import 'package:mati_plugin_flutter/mati_plugin_flutter.dart'; import 'package:fluttertoast/fluttertoast.dart';

void main() { runApp(MyApp()); }

class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: 'Mati flutter plugin demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } }

class MyHomePage extends StatefulWidget { MyHomePage({Key? key}) : super(key: key);

@override _MyHomePageState createState() => _MyHomePageState(); }

class _MyHomePageState extends State {

void showMatiFlow() { MatiFlutter.showMatiFlow("CLIENT_ID", "FLOW_ID", {}); MatiFlutter.resultCompleter.future.then((result) => Fluttertoast.showToast( msg: result is ResultSuccess ? "Success ${result.verificationId}" : "Cancelled", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM)); }

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Mati flutter plugin demo"), ), body: Center( child: ElevatedButton( onPressed: showMatiFlow, child: const Text('Verify me'), ) ) ); } }

brasizza commented 2 years ago

@brasizza The plugin integration not right. You use methodChannel but it's not need. for integration please use this

import 'package:flutter/material.dart'; import 'package:mati_plugin_flutter/mati_plugin_flutter.dart'; import 'package:fluttertoast/fluttertoast.dart';

void main() { runApp(MyApp()); }

class MyApp extends StatelessWidget { @OverRide Widget build(BuildContext context) { return MaterialApp( title: 'Mati flutter plugin demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } }

class MyHomePage extends StatefulWidget { MyHomePage({Key? key}) : super(key: key);

@OverRide _MyHomePageState createState() => _MyHomePageState(); }

class _MyHomePageState extends State {

void showMatiFlow() { MatiFlutter.showMatiFlow("CLIENT_ID", "FLOW_ID", {}); MatiFlutter.resultCompleter.future.then((result) => Fluttertoast.showToast( msg: result is ResultSuccess ? "Success ${result.verificationId}" : "Cancelled", toastLength: Toast.LENGTH_SHORT, gravity: ToastGravity.BOTTOM)); }

@OverRide Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Mati flutter plugin demo"), ), body: Center( child: ElevatedButton( onPressed: showMatiFlow, child: const Text('Verify me'), ) ) ); } }

Hello!, the code that i share on printscren is your code from your package its fully working in android. i made all my app in android and then when i put the same code in IOS this error start to happen.

this is part of my code

Future showMatiFlow() async { String clientId = dotenv.env['MATI_CLIENT_ID'] ?? ''; String flowId = dotenv.env['MATI_FLOW_ID'] ?? ''; await MatiFlutter.showMatiFlow( clientId, flowId, { 'usuario': Get.find().usuarioModel.id, }, ); MatiFlutter.resultCompleter.future.then((result) async { if (result is ResultSuccess) { usuario.idVerificacao = result.verificationId; usuario.contaVerificada = -1; //em procesos de verificacao Utils.showLoading(); await salvarUsuarioOnline(usuario); await salvarUsuarioLocal(usuario); Get.close(0); Get.snackbar( 'Verificação concluída', 'Aguarde a finalização das verificações do seu documento', backgroundColor: Colors.green.shade800, colorText: Colors.white, ); } else { Get.snackbar( 'OPS!', 'Validação do documento cancelada!', backgroundColor: Colors.red.shade800, colorText: Colors.white, ); } }); }

AvoSukiasyan commented 2 years ago

@brasizza sorry it was misUnderstanding. can you show your podFile please

brasizza commented 2 years ago

@brasizza sorry it was misUnderstanding. can you show your podFile please

Sorry mate i had this in my podfile

  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'

I changed to 12 and i think it's workin now. Sorry and thanks for your kindness

AvoSukiasyan commented 2 years ago

No worries and thanks too

Sent from my iPhone

On 27 Dec 2021, at 22:35, Marcus Brasizza @.***> wrote:

 @brasizza sorry it was misUnderstanding. can you show your podFile please

Sorry mate i had this in my podfile

config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' I changed to 12 and i think it's workin now. Sorry and thanks for your kindness

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.