Lately, I’ve determined to construct my app in flutter along with firebase. After following the directions the whole lot labored. Nonetheless, the difficulty got here after I determined so as to add google authentication that firebase offers. I changed the file to the ios folder and now I simply get an error: “Error operating pod set up. Error launching software on iPhone 16 Professional.”. I’m on an m2 Macbook professional and put in ruby as talked about within the docs.
I attempted to exchange the file to a newly generated .plist file made by firebase nevertheless it did not repair the difficulty. I’m most likely doing one thing improper however I am uncertain tips on how to repair this. Any assist shall be enormously appreciated! P.S. I did all of the steps for connecting firebase with flutter together with the logging in.
I attempted:
-flutter clear, flutter pub get
That is my full code:
import 'bundle:flutter/materials.dart';
import 'bundle:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
import 'bundle:google_fonts/google_fonts.dart'; // For contemporary typography
import 'bundle:firebase_auth/firebase_auth.dart';
// import 'bundle:cloud_firestore/cloud_firestore.dart';
void fundamental() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(choices: DefaultFirebaseOptions.currentPlatform);
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget construct(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
textTheme: GoogleFonts.poppinsTextTheme(), // Trendy typography
primarySwatch: Colours.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
initialRoute: "https://stackoverflow.com/",
routes: {
"https://stackoverflow.com/": (context) => HomeScreen(),
'/login': (context) => LoginScreen(),
'/signup': (context) => SignUpScreen(),
'/mainMenu': (context) => MainMenu(),
},
);
}
}
class HomeScreen extends StatelessWidget {
@override
Widget construct(BuildContext context) {
return Scaffold(
backgroundColor: Colours.white,
physique: Middle(
baby: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
baby: Column(
mainAxisAlignment: MainAxisAlignment.middle,
kids: [
AnimatedOpacity(
opacity: 1.0,
duration: Duration(seconds: 1),
child: Text(
'Hi there! 👋',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(height: 40),
SleekButton(
text: 'Sign up',
color: Colors.blue,
onPressed: () {
Navigator.pushNamed(context, '/signup');
},
),
SizedBox(height: 20),
SleekButton(
text: 'Log in',
color: Colors.green,
onPressed: () {
Navigator.pushNamed(context, '/login');
},
),
SizedBox(height: 100),
AnimatedOpacity(
opacity: 1.0,
duration: Duration(seconds: 1),
child: Text(
'Lock in',
style: TextStyle(
fontSize: 40,
fontWeight: FontWeight.normal,
color: Colors.black,
),
),
),
],
),
),
),
);
}
}
class LoginScreen extends StatefulWidget {
@override
_LoginScreenState createState() => _LoginScreenState();
}
class _LoginScreenState extends State {
closing _emailController = TextEditingController();
closing _passwordController = TextEditingController();
Future _login() async {
strive {
await FirebaseAuth.occasion.signInWithEmailAndPassword(
e mail: _emailController.textual content.trim(),
password: _passwordController.textual content.trim(),
);
Navigator.pushReplacementNamed(context, '/mainMenu');
} on FirebaseAuthException catch (e) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content material: Textual content(e.message ?? 'An error occurred')));
}
}
@override
Widget construct(BuildContext context) {
return Scaffold(
backgroundColor: Colours.white,
physique: Middle(
baby: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
baby: Column(
mainAxisAlignment: MainAxisAlignment.middle,
kids: [
AnimatedOpacity(
opacity: 1.0,
duration: Duration(seconds: 1),
child: Text(
'Welcome back! 👋',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(height: 20),
SleekTextField(hintText: 'Email', controller: _emailController),
SizedBox(height: 20),
SleekTextField(
hintText: 'Password',
obscureText: true,
controller: _passwordController,
),
SizedBox(height: 20),
SleekButton(
text: 'Log in',
color: Colors.green,
onPressed: _login,
),
SizedBox(height: 20),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(
'Back',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black54,
),
),
),
],
),
),
),
);
}
}
class SignUpScreen extends StatefulWidget {
@override
_SignUpScreenState createState() => _SignUpScreenState();
}
class _SignUpScreenState extends State {
closing _emailController = TextEditingController();
closing _passwordController = TextEditingController();
closing _confirmPasswordController = TextEditingController();
Future _signUp() async {
if (_passwordController.textual content.trim() !=
_confirmPasswordController.textual content.trim()) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content material: Textual content('Passwords don't match')));
return;
}
strive {
await FirebaseAuth.occasion.createUserWithEmailAndPassword(
e mail: _emailController.textual content.trim(),
password: _passwordController.textual content.trim(),
);
Navigator.pushReplacementNamed(context, '/mainMenu');
} on FirebaseAuthException catch (e) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content material: Textual content(e.message ?? 'An error occurred')));
}
}
@override
Widget construct(BuildContext context) {
return Scaffold(
backgroundColor: Colours.white,
physique: Middle(
baby: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
baby: Column(
mainAxisAlignment: MainAxisAlignment.middle,
kids: [
AnimatedOpacity(
opacity: 1.0,
duration: Duration(seconds: 1),
child: Text(
'Create an account 🚀',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(height: 20),
SleekTextField(hintText: 'Email', controller: _emailController),
SizedBox(height: 20),
SleekTextField(
hintText: 'Password',
obscureText: true,
controller: _passwordController,
),
SizedBox(height: 20),
SleekTextField(
hintText: 'Repeat Password',
obscureText: true,
controller: _confirmPasswordController,
),
SizedBox(height: 20),
SleekButton(
text: 'Sign up',
color: Colors.blue,
onPressed: _signUp,
),
SizedBox(height: 20),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(
'Back',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.black54,
),
),
),
],
),
),
),
);
}
}
class MainMenu extends StatelessWidget {
@override
Widget construct(BuildContext context) {
return Scaffold(
backgroundColor: Colours.white,
physique: Middle(
baby: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20.0),
baby: Column(
mainAxisAlignment: MainAxisAlignment.middle,
kids: [
AnimatedOpacity(
opacity: 1.0,
duration: Duration(seconds: 1),
child: Text(
'Welcome back! 👋',
style: TextStyle(
fontSize: 28,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
),
SizedBox(height: 40),
Card(
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: Container(
width: 363,
height: 254,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.lightBlueAccent],
start: Alignment.topLeft,
finish: Alignment.bottomRight,
),
borderRadius: BorderRadius.round(20),
),
baby: Middle(
baby: Textual content(
"Your Content material",
type: TextStyle(
fontSize: 22,
coloration: Colours.white,
fontWeight: FontWeight.daring,
),
),
),
),
),
SizedBox(peak: 40),
AnimatedOpacity(
opacity: 1.0,
period: Period(seconds: 1),
baby: Textual content(
'Lock in',
type: TextStyle(
fontSize: 40,
fontWeight: FontWeight.regular,
coloration: Colours.black,
),
),
),
],
),
),
),
);
}
}
class SleekButton extends StatelessWidget {
closing String textual content;
closing Coloration coloration;
closing VoidCallback onPressed;
SleekButton({
required this.textual content,
required this.coloration,
required this.onPressed,
});
@override
Widget construct(BuildContext context) {
return AnimatedContainer(
period: Period(milliseconds: 300),
width: double.infinity,
peak: 60,
ornament: BoxDecoration(
coloration: coloration,
borderRadius: BorderRadius.round(15),
boxShadow: [
BoxShadow(
color: color.withOpacity(0.3),
blurRadius: 10,
spreadRadius: 2,
offset: Offset(0, 4),
),
],
),
baby: TextButton(
onPressed: onPressed,
baby: Textual content(
textual content,
type: TextStyle(
fontSize: 18,
fontWeight: FontWeight.daring,
coloration: Colours.white,
),
),
),
);
}
}
class SleekTextField extends StatelessWidget {
closing String hintText;
closing bool obscureText;
closing TextEditingController? controller;
SleekTextField({
required this.hintText,
this.obscureText = false,
this.controller,
});
@override
Widget construct(BuildContext context) {
return AnimatedContainer(
period: Period(milliseconds: 300),
width: double.infinity,
peak: 60,
ornament: BoxDecoration(
coloration: Colours.gray[100],
borderRadius: BorderRadius.round(15),
border: Border.all(coloration: Colours.gray[300]!),
),
baby: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
baby: TextField(
controller: controller,
obscureText: obscureText,
ornament: InputDecoration(
hintText: hintText,
border: InputBorder.none,
),
),
),
);
}
}
That is the complete error:
JSON::ParserError - Didn't parse JSON at file: '/Customers/maximnota/.cocoapods/repos/trunk/Specs/c/8/7/gRPC-C++/1.65.6-pre2/gRPC-C++.podspec.json'.
sudden token at '"src/core/l'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/specification/json.rb:66:in 'Pod::Specification.from_json'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/specification.rb:759:in 'Pod::Specification.from_string'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/specification.rb:733:in 'Pod::Specification.from_file'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-core-1.16.2/lib/cocoapods-core/supply.rb:188:in 'Pod::Supply#specification'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/resolver/lazy_specification.rb:37:in 'Pod::Specification::Set::LazySpecification#specification'
/choose/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/delegate.rb:348:in 'block in delegating_block'
/choose/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/delegate.rb:349:in 'block in delegating_block'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/resolver.rb:178:in 'Pod::Resolver#dependencies_for'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:18:in 'block in Molinillo::Delegates::SpecificationProvider#dependencies_for'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:77:in 'Molinillo::Delegates::SpecificationProvider#with_no_such_dependency_error_handling'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/delegates/specification_provider.rb:17:in 'Molinillo::Delegates::SpecificationProvider#dependencies_for'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:809:in 'block in Molinillo::Resolver::Decision#group_possibilities'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:808:in 'Array#reverse_each'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:808:in 'Molinillo::Resolver::Decision#group_possibilities'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:779:in 'Molinillo::Resolver::Decision#possibilities_for_requirement'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:761:in 'Molinillo::Resolver::Decision#push_state_for_requirements'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:744:in 'Molinillo::Resolver::Decision#require_nested_dependencies_for'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:727:in 'Molinillo::Resolver::Decision#activate_new_spec'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:684:in 'Molinillo::Resolver::Decision#attempt_to_activate'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:254:in 'Molinillo::Resolver::Decision#process_topmost_state'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/decision.rb:182:in 'Molinillo::Resolver::Decision#resolve'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/molinillo-0.8.0/lib/molinillo/resolver.rb:43:in 'Molinillo::Resolver#resolve'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/resolver.rb:94:in 'Pod::Resolver#resolve'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1082:in 'block in Pod::Installer::Analyzer#resolve_dependencies'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.part'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:1080:in 'Pod::Installer::Analyzer#resolve_dependencies'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/analyzer.rb:125:in 'Pod::Installer::Analyzer#analyze'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:422:in 'Pod::Installer#analyze'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:244:in 'block in Pod::Installer#resolve_dependencies'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in 'Pod::UserInterface.part'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:243:in 'Pod::Installer#resolve_dependencies'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:162:in 'Pod::Installer#set up!'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/command/set up.rb:52:in 'Pod::Command::Set up#run'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/claide-1.1.0/lib/claide/command.rb:334:in 'CLAide::Command.run'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in 'Pod::Command.run'
/choose/homebrew/lib/ruby/gems/3.4.0/gems/cocoapods-1.16.2/bin/pod:55:in ''
/choose/homebrew/Cellar/cocoapods/1.16.2_1/libexec/bin/pod:25:in 'Kernel#load'
/choose/homebrew/Cellar/cocoapods/1.16.2_1/libexec/bin/pod:25:in ''