Flutter: “ flutter build ios --release -v ” failed and show Command PhaseScriptExecution failed with a nonzero exit code . SOS - flutter-packages

I was using VSCode to archive an ios .ipa. When I tried "flutter build ios --release", it failed with message: " Command PhaseScriptExecution failed with a nonzero exit code". I google this error and found many solutions, but none of them works for me. These solutions refer to "Key Chain Access","delete pods and clean build folder" and so on. I even update my MacOS system and 'XCode' to the newest version, but no miracle happens.
Finally I found an useful command "flutter build ios --release -v" to show the detail info, here is the log on VSCode:
[ +6 ms] Encountered error while building for device.
[ +2 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 _BuildIOSSubCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:277:7)
<asynchronous suspension>
#2 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1125:27)
<asynchronous suspension>
#3 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#4 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:288:9)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:236:5)
<asynchronous suspension>
#8 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 main (package:flutter_tools/executable.dart:92:3)
<asynchronous suspension>
It seems like something wrong with my dart SDK, I'll be appreciate anyone helps me.
PS: This strange error only shows in my own MacBook Pro, it packages smoothly when I run the build command in my company's MacBook Pro.

you can try running the command:
flutter clean
rm -rf ios/Flutter/Flutter.framework
flutter build ios --release
OR uninstall flutter's SDK and try reinstall it again.

Related

I am getting this E/flutter (25055) error when I am running my App (Flutter , FireBase

I am getting this E/flutter (25055) error when I am running my App (Flutter, fireBase
I tried Updating my flutter but still, I am getting the same logs
and these logs are making my App unstable and the App is crashing a lot
E/flutter (25055): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Bad state: field does not exist within the DocumentSnapshotPlatform
E/flutter (25055): #0 DocumentSnapshotPlatform.get._findKeyValueInMap (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:86:7)
E/flutter (25055): #1 DocumentSnapshotPlatform.get._findComponent (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:104:41)
E/flutter (25055): #2 DocumentSnapshotPlatform.get (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:120:26)
E/flutter (25055): #3 _JsonDocumentSnapshot.get (package:cloud_firestore/src/document_snapshot.dart:92:48)
E/flutter (25055): #4 _JsonDocumentSnapshot.[] (package:cloud_firestore/src/document_snapshot.dart:96:40)
E/flutter (25055): #5 _MyHomePageState.getLists (package:form_app/pages/home.dart:518:30)
E/flutter (25055): <asynchronous suspension>
E/flutter (25055): #6 _MyHomePageState._getUnitNamesData (package:form_app/pages/home.dart:495:33)
E/flutter (25055): <asynchronous suspension>
E/flutter (25055):
my Flutter doctor
C:\src\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19041.450], locale en-US)
• Flutter version 2.2.3 at C:\src\flutter
• Framework revision f4abaa0735 (7 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:/Users/afran/AppData/Local/Android/Sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = C:/Users/afran/AppData/Local/Android/Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
[√] IntelliJ IDEA Ultimate Edition (version 2020.2)
• IntelliJ at F:\IntelliJ IDEA 2020.2.3
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
[√] VS Code (version 1.55.2)
• VS Code at C:\Users\afran\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.21.0
[√] Connected device (2 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.131
• No issues found!
My App dependencies
dependencies:
flutter:
sdk: flutter
flutter_spinkit: ^5.0.0
geolocator: ^7.0.1
#geolocation: ^1.1.2
cloud_firestore: ^2.4.0
firebase_storage: ^10.0.1
permission_handler: ^8.1.4+2
firebase_core: ^1.0.1
url_launcher: ^6.0.2
firebase_auth: ^3.0.1
provider: ^5.0.0
google_fonts: ^2.0.0
shared_preferences: ^2.0.4
connectivity: ^3.0.2
mailer: ^5.0.1
firebase_messaging: ^10.0.4
flutter_local_notifications: ^5.0.0+1
The exception says the problem:
Unhandled Exception: Bad state: field does not exist within the DocumentSnapshotPlatform
Also you have the call methods:
E/flutter (25055): #0 DocumentSnapshotPlatform.get._findKeyValueInMap (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:86:7)
E/flutter (25055): #1 DocumentSnapshotPlatform.get._findComponent (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:104:41)
E/flutter (25055): #2 DocumentSnapshotPlatform.get (package:cloud_firestore_platform_interface/src/platform_interface/platform_interface_document_snapshot.dart:120:26)
E/flutter (25055): #3 _JsonDocumentSnapshot.get (package:cloud_firestore/src/document_snapshot.dart:92:48)
E/flutter (25055): #4 _JsonDocumentSnapshot.[] (package:cloud_firestore/src/document_snapshot.dart:96:40)
E/flutter (25055): #5 _MyHomePageState.getLists (package:form_app/pages/home.dart:518:30)
E/flutter (25055): <asynchronous suspension>
E/flutter (25055): #6 _MyHomePageState._getUnitNamesData (package:form_app/pages/home.dart:495:33)
E/flutter (25055): <asynchronous suspension>
E/flutter (25055):
You have to check at these rows what happens. We can't debug this because we don't have the code. You ask for a field that is not existing so it throws this exception.

Firebase initialization error on flutter MissingPluginException

I am developing an app in flutter I am using firebase in this app. And I am using following dependencies:
firebase_messaging: ^10.0.0
firebase_core: ^1.2.0
cloud_firestore: ^2.2.0
firebase_storage: ^8.1.0
I am initializing firebase like this:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
This whole code was working fine till today's morning but after that it is giving this error everytime:
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:53273/b_8_mVgWJY0=/ws
Syncing files to device sdk gphone x86...
I/flutter (15902): completed
E/flutter (15902): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)
E/flutter (15902): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:7)
E/flutter (15902): <asynchronous suspension>
E/flutter (15902): #1 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:344:35)
E/flutter (15902): <asynchronous suspension>
E/flutter (15902): #2 MethodChannelFirebase._initializeCore (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:30:23)
E/flutter (15902): <asynchronous suspension>
E/flutter (15902): #3 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:77:7)
E/flutter (15902): <asynchronous suspension>
E/flutter (15902): #4 Firebase.initializeApp (package:firebase_core/src/firebase.dart:41:31)
E/flutter (15902): <asynchronous suspension>
E/flutter (15902):
Is there anything wrong with android studio or flutter SDK itself? I have also noticed that there is one file generated that was not there earlier when the app was working fully functional the file is named "generated_plugin_registrant.dart".
Update:
I removed flutter from my windows and again installed it but it didn't work as well. Now I think I should uninstall android studio completely and again install it because I don't find any error or wrong implementation in my code till now, Please tell me if there is any.
Please help me.
Thanks for your replies.
I searched a lot on the internet but the solution was very simple. It was happening because the following code was missing in my MainActivity.kt.
Code:
override fun configureFlutterEngine(#NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine); }
It was not registering the flutter plugins that's why it was giving an error it took me 2 and a half days I hope if someone else is facing this issue they can solve it earlier than me.
And thanks for all your replies.
I had the same problem. I also tried many solution like you, but could not able to resolve it issues.
Latter, I ended up creating a new project carefully copying firebase and multiple other packages from the original project. After that I copied every single file in lib/android along with their respective configurations in build.gradle and manifests. For iOS I just copied the entire project and that worked immediately.
You also can try like my. Create a new project and copy everything from your old project to new one, one by one to see this issue resolved or not.
Try running
flutter clean
flutter pub get
in the terminal and see if that helps
Have you tried running flutter clean in the terminal?
flutter clean
and then
flutter pub get
edit:
Or,
in android/build.gradle under dependencies, you could use another version of gradle build tools if it helps
classpath 'com.android.tools.build:gradle:3.5.0'

Flutter Plugin.java uses or overrides a deprecated API

when I run my program flutter on android studio, I get the following error,and i have a white screen in my device.
Note: C:\Src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-1.0.3\android\src\main\java\io\flutter\plugins\firebase\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_share-2.0.0\android\src\main\java\com\example\fluttershare\FlutterSharePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Src\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_auth-1.0.3\android\src\main\java\io\flutter\plugins\firebase\auth\FlutterFirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:63581/tYPCfAyfdsI=/ws
Syncing files to device LG M250...
E/flutter (12903): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: [core/not-initialized] Firebase has not been correctly initialized. Have you added the "google-services.json" file to the project?
E/flutter (12903):
E/flutter (12903): View the Android Installation documentation for more information: https://firebase.flutter.dev/docs/installation/android
E/flutter (12903):
E/flutter (12903): #0 MethodChannelFirebase.initializeApp (package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:88:9)
E/flutter (12903): <asynchronous suspension>
E/flutter (12903): #1 Firebase.initializeApp (package:firebase_core/src/firebase.dart:41:31)
E/flutter (12903): <asynchronous suspension>
E/flutter (12903): #2 main (package:medecins_oran/main.dart:12:3)
E/flutter (12903): <asynchronous suspension>
E/flutter (12903):

Firebase has not been correctly initialized. Have you added the "google-services.json" file to the project

I'm getting this error when i run my app. I downloaded the google-services.json into my android/app folder. I have put in the
apply plugin: 'com.google.gms.google-services'
into my app/build.gradle file. Originally i had not put in the "apply plugin" so i put it in later and it doesn't seem to have made a difference. I also put my
classpath 'com.google.gms:google-services:4.3.5'
into my android/build.gradle. The entire error when i run the app is
E/flutter ( 4213): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception:
[core/not-initialized] Firebase has not been correctly initialized.
Have you added the
"google-services.json" file to the project?
E/flutter ( 4213):
E/flutter ( 4213): View the Android Installation documentation for more information:
https://firebase.flutter.dev/docs/installation/android
E/flutter ( 4213):
E/flutter ( 4213): #0 MethodChannelFirebase.initializeApp
(package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart:88:9)
E/flutter ( 4213): <asynchronous suspension>
E/flutter ( 4213): #1 Firebase.initializeApp (package:firebase_core/src/firebase.dart:41:31)
E/flutter ( 4213): <asynchronous suspension>
E/flutter ( 4213): #2
main (package:rider_app/main.dart:12:3)
E/flutter ( 4213): <asynchronous suspension>
E/flutter ( 4213):
(edit: i see there's more to the errors that i might not have seen , i'm hoping you guys will make sense of them)
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
Note: "path"\flutter_windows_2.0.4-stable\.pub-cache\hosted\pub.dartlang.org
\firebase_core-1.0.3\android\src\main\java\io\flutter\plugins\firebase
\core\FlutterFirebaseCorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: "path"\flutter_windows_2.0.4-stable\.pub-cache\hosted\pub.dartlang.org
\firebase_auth-1.0.2\android\src\main\java\io\flutter\plugins\firebase
\auth\FlutterFirebaseAuthPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:55393/AAigea5LZbA=/ws
Syncing files to device Android SDK built for x86...
D/EGL_emulation( 8043): eglMakeCurrent: 0x9c861020: ver 2 0 (tinfo
0xaa003f90)
E/flutter ( 8043): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled
Exception: [core/not-initialized] Firebase has not been correctly
initialized. Have you added the "google-services.json" file to the project?
E/flutter ( 8043):
E/flutter ( 8043): View the Android Installation documentation for more
information: https://firebase.flutter.dev/docs/installation/android
E/flutter ( 8043):
E/flutter ( 8043): #0 MethodChannelFirebase.initializeApp
(package:firebase_core_platform_interface/src/method_channel
/method_channel_firebase.dart:88:9)
E/flutter ( 8043): <asynchronous suspension>
E/flutter ( 8043): #1 Firebase.initializeApp (package:firebase_core/src/firebase.dart:41:31)
E/flutter ( 8043): <asynchronous suspension>
E/flutter ( 8043): #2 main (package:riderapp/main.dart:14:3)
E/flutter ( 8043): <asynchronous suspension>
E/flutter ( 8043):
pubspec,yaml
cupertino_icons: ^1.0.2
firebase_core: ^1.0.3
firebase_auth: ^1.0.2
firebase_database: ^6.1.2
fluttertoast: ^8.0.3
gradle/build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.google.gms:google-services:4.3.5'
classpath "org.jetbrains.kotlin:kotlin-gradle- plugin:$kotlin_version"
}
}
app/build.gradle
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// this is incase i get error archives can't exceed 64k
implementation 'com.android.support:multidex:1.0.3'
}
//apply plugin:
apply plugin: 'com.google.gms.google-services'
flutter clean - i tried
flutter get packages - i tried
flutter doctor -v - i tried
Thank you to #Nishuthan S for posting the solution for me. As you can see in the comments what he suggested.
try flutter create . then flutter clean then flutter run if that doesn't work you can try back up your lib folder and pubspec delete the project create a new project in the same package name and replace lib and pubspec –
After i did what he suggested, i went and readded the images, fonts and sounds back to the new project. I typed flutter pub get to check pubspec.yaml was working fine. I readded the dependencies from firebase into the correct files, this is found on their website depending on your own project. Now the project is working. Thanks to all for your help
In your main function add await Firebase.initializeApp();
Example:
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
Package firebase_core: ^1.0.3 https://pub.dev/packages/firebase_core

unable to login wordpress localhost xaamp

I am getting an error whenever i try to open http://localhost/wordpress/wp-admin/
Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php:1668 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\wp-db.php(632): wpdb->db_connect() #1 C:\xampp\htdocs\wordpress\wp-includes\load.php(425): wpdb->__construct('root', '', 'practice_debut', 'localhost') #2 C:\xampp\htdocs\wordpress\wp-settings.php(116): require_wp_db() #3 C:\xampp\htdocs\wordpress\wp-config.php(90): require_once('C:\xampp\htdocs...') #4 C:\xampp\htdocs\wordpress\wp-load.php(37): require_once('C:\xampp\htdocs...') #5 C:\xampp\htdocs\wordpress\wp-blog-header.php(13): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\wordpress\index.php(17): require('C:\xampp\htdocs...') #7 {main} thrown in C:\xampp\htdocs\wordpress\wp-includes\wp-db.php on line 1668
Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in C:\xampp\htdocs\wordpress\wp-includes\formatting.php:4316 Stack trace: #0 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(190): esc_url('https://wordpre...') #1 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false) #2 C:\xampp\htdocs\wordpress\wp-includes\class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false) #3 [internal function]: WP_Fatal_Error_Handler->handle() #4 {main} thrown in C:\xampp\htdocs\wordpress\wp-includes\formatting.php on line 4316
when i tried for solutions i came across this one "untick mysqli and tick nd_mysqli"
but i don't know how to do this in localhost xamamp. I am new to wordpress and localhost.
Also when i tried to open http://localhost/phpmyadmin/
i get this error
phpMyAdmin - Error
The mysqli extension is missing. Please check your PHP configuration. See [a#doc/html/faq.html#faqmysql#documentation]our documentation for more information.
Try to use Wampserver64 application. Maybe your problem solved.

Resources