When I run flutter build apk -v, I see the following output:
[ +1 ms] *********************************************************
[ ] WARNING: This version of shared_preferences will break your Android build if it or its
dependencies aren't compatible with AndroidX.
[ +1 ms] See ---(google url)--- for more information on the problem and how to fix it.[ +1 ms] This warning prints for all Android build failures. The real root cause of the
error may be unrelated.
[ +5 ms] *********************************************************
[ +7 ms] 197 actionable tasks: 7 executed, 190 up-to-date
[ +370 ms] Running Gradle task 'assembleRelease'... (completed in 46.8s)
[ +5 ms] "flutter apk" took 53,500ms.
[ ] "flutter apk" took 53,500ms.
Gradle task assembleRelease failed with exit code 1
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:507:5)
<asynchronous suspension>
#2 buildGradleProject (package:flutter_tools/src/android/gradle.dart:346:14)
<asynchronous suspension>
#3 buildApk (package:flutter_tools/src/android/apk.dart:34:9)
<asynchronous suspension>
#4 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:79:11)
<asynchronous suspension>
#5 FlutterCommand.verifyThenRunCommand
(package:flutter_tools/src/runner/flutter_command.dart:478:18)
<asynchronous suspension>
#6 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:383:33)
<asynchronous suspension>
#7 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#8 _rootRun (dart:async/zone.dart:1124:13)
#9 _CustomZone.run (dart:async/zone.dart:1021:19)
#10 _runZoned (dart:async/zone.dart:1516:10)
#11 runZoned (dart:async/zone.dart:1463:12)
#12 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#13 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:375:20)
#14 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
<asynchronous suspension>
#15 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:396:21)
<asynchronous suspension>
#16 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#17 _rootRun (dart:async/zone.dart:1124:13)
#18 _CustomZone.run (dart:async/zone.dart:1021:19)
#19 _runZoned (dart:async/zone.dart:1516:10)
#20 runZoned (dart:async/zone.dart:1463:12)
#21 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#22 FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:356:19)
<asynchronous suspension>
#23 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#24 new Future.sync (dart:async/future.dart:224:31)
#25 CommandRunner.run (package:args/command_runner.dart:112:14)
#26 FlutterCommandRunner.run
(package:flutter_tools/src/runner/flutter_command_runner.dart:242:18)
#27 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:22)
<asynchronous suspension>
#28 _rootRun (dart:async/zone.dart:1124:13)
#29 _CustomZone.run (dart:async/zone.dart:1021:19)
#30 _runZoned (dart:async/zone.dart:1516:10)
#31 runZoned (dart:async/zone.dart:1500:12)
#32 run.<anonymous closure> (package:flutter_tools/runner.dart:60:18)
<asynchronous suspension>
#33 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#34 _rootRun (dart:async/zone.dart:1124:13)
#35 _CustomZone.run (dart:async/zone.dart:1021:19)
#36 _runZoned (dart:async/zone.dart:1516:10)
#37 runZoned (dart:async/zone.dart:1463:12)
#38 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#39 runInContext (package:flutter_tools/src/context_runner.dart:56:24)
<asynchronous suspension>
#40 run (package:flutter_tools/runner.dart:51:10)
#41 main (package:flutter_tools/executable.dart:62:9)
<asynchronous suspension>
#42 main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#43 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#44 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
When I change (android\app)build.gradle like this, the same output is shown.
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
useProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
I think androidx has a problem but I don't know what to do. I tried to migrate androidx, the first time I succeeded but when I tried once again they said No Usages Found in the Project, so I am not able to do it one more time
Additional Information :
I used android studio, and I upgraded everything. gradle, sdkversion(to 29) distrubuturl(to 5.4.1) and also added android.useAndroidx = true
Related
Getting this error i have try to fixed this ref:Application.kt: Unresolved reference: firebasemessaging but didnt work so i need to posted again i also tried to delete the application.kt file but didnt work. If anyone know the solution please let me know what i am doing wrong so i can learn to not repeat these again
ext.kotlin_version = '1.4.32'
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
classpath 'com.google.gms:google-services:4.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
package com.godatu.dance
import io.flutter.app.FlutterApplication
import io.flutter.plugin.common.PluginRegistry
import io.flutter.plugins.firebasemessaging.FlutterFirebaseMessagingService
class Application : FlutterApplication(), PluginRegistry.PluginRegistrantCallback {
override fun onCreate() {
super.onCreate()
FlutterFirebaseMessagingService.setPluginRegistrant(this)
}
override fun registerWith(registry: PluginRegistry?) {
if (registry != null) {
FirebaseCloudMessagingPluginRegistrant.registerWith(registry)
FlutterLocalNotificationPluginRegistrant.registerWith(registry)
FlutterPathProviderPluginRegistrant.registerWith(registry)
}
}
}
enter code here
[ +2 ms] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\Application.kt: (6, 27): Unresolved reference: firebasemessaging
[ +3 ms] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\Application.kt: (7, 27): Unresolved reference: firebasemessaging
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\Application.kt: (12, 9): Unresolved reference: FlutterFirebaseMessagingService
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\Application.kt: (20, 7): Redeclaration: FirebaseCloudMessagingPluginRegistrant
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\Application.kt: (26, 13): Unresolved reference: FirebaseMessagingPlugin
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\FirebaseCloudMessagingPluginRegistrant.kt: (5, 27): Unresolved reference: firebasemessaging
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\FirebaseCloudMessagingPluginRegistrant.kt: (8, 7): Redeclaration: FirebaseCloudMessagingPluginRegistrant
[ ] e: C:\Users\Admin\Desktop\Android\godatu-App\android\app\src\main\kotlin\com\godatu\dance\FirebaseCloudMessagingPluginRegistrant.kt: (17, 17): Unresolved reference: FirebaseMessagingPlugin
[ +84 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':app:compileDebugKotlin'.
[ ] > Compilation error. See log for more details
[ ] * Try:
[ ] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[ ] * Get more help at https://help.gradle.org
[ ] BUILD FAILED in 27s
[ ] 399 actionable tasks: 5 executed, 394 up-to-date
[{"event":"app.progress","params":{"appId":"82f5465d-087d-4b13-8c4a-7ae1698e399b","id":"0","progressId":null,"finished":true}}]
[+5408 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +4 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:550:9)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#11 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#12 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#15 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
[{"event":"app.stop","params":{"appId":"82f5465d-087d-4b13-8c4a-7ae1698e399b"}}]
[ +18 ms] "flutter run" took 36,338ms.
[{"id":0,"error":"app '82f5465d-087d-4b13-8c4a-7ae1698e399b' not found","trace":"#0 AppDomain.stop (package:flutter_tools/src/commands/daemon.dart:698:7)\n#1 Domain.handleCommand.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:217:34)\n#2 new Future.sync (dart:async/future.dart:218:31)\n#3 Domain.handleCommand (package:flutter_tools/src/commands/daemon.dart:215:5)\n#4 Daemon._handleRequest (package:flutter_tools/src/commands/daemon.dart:141:28)\n#5 _rootRunUnary (dart:async/zone.dart:1362:47)\n#6 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#7 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#8 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#9 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#10 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#11 _MapStream._handleData (dart:async/stream_pipe.dart:218:10)\n#12 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#13 _rootRunUnary (dart:async/zone.dart:1362:47)\n#14 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#16 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#17 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#18 _ForwardingStreamSubscription._add (dart:async/stream_pipe.dart:123:11)\n#19 _WhereStream._handleData (dart:async/stream_pipe.dart:195:12)\n#20 _ForwardingStreamSubscription._handleData (dart:async/stream_pipe.dart:153:13)\n#21 _rootRunUnary (dart:async/zone.dart:1362:47)\n#22 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#23 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#24 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#25 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#26 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#27 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#28 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#29 _LineSplitterSink._addLines (dart:convert/line_splitter.dart:155:13)\n#30 _LineSplitterSink.addSlice (dart:convert/line_splitter.dart:130:5)\n#31 StringConversionSinkMixin.add (dart:convert/string_conversion.dart:163:5)\n#32 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#33 _rootRunUnary (dart:async/zone.dart:1362:47)\n#34 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#35 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#36 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#37 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#38 _SinkTransformerStreamSubscription._add (dart:async/stream_transformers.dart:63:11)\n#39 _EventSinkWrapper.add (dart:async/stream_transformers.dart:13:11)\n#40 _StringAdapterSink.add (dart:convert/string_conversion.dart:238:11)\n#41 _StringAdapterSink.addSlice (dart:convert/string_conversion.dart:243:7)\n#42 _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:317:20)\n#43 _Utf8ConversionSink.add (dart:convert/string_conversion.dart:310:5)\n#44 _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:72:18)\n#45 _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)\n#46 _rootRunUnary (dart:async/zone.dart:1362:47)\n#47 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#48 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#49 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#50 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#51 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#52 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#53 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#54 _Socket._onData (dart:io-patch/socket_patch.dart:2144:41)\n#55 _rootRunUnary (dart:async/zone.dart:1370:13)\n#56 _CustomZone.runUnary (dart:async/zone.dart:1265:19)\n#57 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)\n#58 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)\n#59 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)\n#60 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)\n#61 _StreamController._add (dart:async/stream_controller.dart:607:7)\n#62 _StreamController.add (dart:async/stream_controller.dart:554:5)\n#63 new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1680:33)\n#64 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1192:14)\n#65 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)\n#66 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)\n#67 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:120:13)\n#68 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)\n"}]
You don't need to take care of registrant in flutter v2. It will automatically handles it by itself. Hence you don't need to include Application class.
I'm guessing you're on an older version of Firebase core and messaging and any other firebase plugins you have. I just went through a bunch of similar headaches, tried all those solutions, went through a bunch of github threads, nothing worked.
What did work, was forcing myself to upgrade to null safety just so I could use all the up to date firebase plugins. After that, FCM works like a charm and you don't have to touch your Kotlin/Java file.
When I first tried to implement FCM, I had ended up with a chain of firebase dependency conflicts with firebase storage/analytics etc...that wasn't resolved until I was down to versions 1-2 years old on some of those plugins.
Now with all these current versions
firebase_analytics: ^8.0.0
firebase_core: ^1.0.3
firebase_messaging: ^9.1.1
firebase_storage: ^8.0.3
My Kotlin file is untouched and background notifications don't crash my app.
So it may not be the answer you're looking for, and perhaps not all your dependencies have upgraded to null safety and you can't upgrade anyway, but it's something to consider.
Because if you do upgrade to all the current versions (and Android Embedding if your app is still on V1), then you just follow the FlutterFire FCM Guide and it all just works with very minimal setup.
It appears the Google team did a lot of work to make it a smoother process because people were justifiably pissed off that it was such a messy process getting 2 Google products to play nicely together.
After downloading the flutter archive and installing on macbook, everything works fine, but once I typed the flutter upgrade command the process failed and I got the error below.
Unhandled exception:
Invalid argument(s): Cannot find executable for sysctl.
#0 _getExecutable (package:process/src/interface/local_process_manager.dart:124:5)
#1 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:91:30)
#2 ErrorHandlingProcessManager.runSync.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:649:37)
#3 _runSync (package:flutter_tools/src/base/error_handling_io.dart:548:14)
#4 ErrorHandlingProcessManager.runSync (package:flutter_tools/src/base/error_handling_io.dart:649:12)
#5 _DefaultProcessUtils.runSync (package:flutter_tools/src/base/process.dart:420:51)
#6 _MacOSUtils.hostPlatform (package:flutter_tools/src/base/os.dart:305:25)
#7 _MacOSUtils.name (package:flutter_tools/src/base/os.dart:291:123)
#8 new _DefaultUsage (package:flutter_tools/src/reporting/usage.dart:247:18)
#9 new Usage (package:flutter_tools/src/reporting/usage.dart:81:9)
#10 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:263:20)
#11 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:104:41)
#12 _LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:291:23)
#13 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:92:20)
#14 AppContext.get (package:flutter_tools/src/base/context.dart:121:32)
#15 flutterUsage (package:flutter_tools/src/globals.dart:55:35)
#16 _handleToolError (package:flutter_tools/runner.dart:133:13)
#17 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:87:13)
#18 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:81:17)
#19 _rootRunBinary (dart:async/zone.dart:1222:13)
#20 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
#21 runZonedGuarded.<anonymous closure> (dart:async/zone.dart:1601:18)
#22 _CustomZone.handleUncaughtError (dart:async/zone.dart:1076:19)
#23 Future._propagateToListeners (dart:async/future_impl.dart:646:16)
#24 Future._completeError (dart:async/future_impl.dart:537:5)
#25 _completeOnAsyncError (dart:async-patch/async_patch.dart:264:13)
#26 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart)
<asynchronous suspension>
Please can someone help me?
I had a thing where each call of "flutter" executable did nothing and just returned without output.
remove the flutter sdk and install it fresh, helped in my case.
I want to run my existing flutter app on windows, so I loaded the lastest flutter-desktop-embedding version, placed my code inside and tried to run it. It soon breaks with an exception:
Build process failed. To view the stack trace, please run `flutter run -d windows -v`.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 buildWindows (package:flutter_tools/src/windows/build_windows.dart:82:5)
<asynchronous suspension>
#2 WindowsDevice.buildForDevice (package:flutter_tools/src/windows/windows_device.dart:46:11)
#3 DesktopDevice.startApp (package:flutter_tools/src/desktop_device.dart:87:13)
<asynchronous suspension>
#4 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:416:54)
<asynchronous suspension>
#5 HotRunner.run (package:flutter_tools/src/run_hot.dart:266:39)
<asynchronous suspension>
#6 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:499:37)
<asynchronous suspension>
#7 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:570:18)
#8 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#9 _rootRunUnary (dart:async/zone.dart:1132:38)
#10 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#11 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#12 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#13 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#14 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#15 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#16 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#17 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#18 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#19 _rootRunUnary (dart:async/zone.dart:1132:38)
#20 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#21 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#22 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#23 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#24 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#25 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#26 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#27 IosProject.isSwift (package:flutter_tools/src/project.dart)
#28 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#29 _rootRunUnary (dart:async/zone.dart:1132:38)
#30 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#31 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#32 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#33 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#34 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#35 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#36 _rootRun (dart:async/zone.dart:1124:13)
#37 _CustomZone.run (dart:async/zone.dart:1021:19)
#38 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#39 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#40 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#41 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#42 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#43 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
I am developing on the master channel, already made flutter upgrade and else I think i did everything else I need to do. Running the example comming with flutter-desktop-embedding does not throw any exception, and it seems that if I copy my lib folder into the examples folder, the app will not build.
Does anyone face this issue too?
This problem is due Flutter Version to Solve it
Open Terminal and Write flutter upgrade --force
Open Your Windows Flutter Project and Write flutter run
Steps to Reproduce
follow https://flutter.dev/docs/get-started/install/windows
git clone -b stable https://github.com/flutter/flutter.git
updated my Edit environment variables
Logs
C:\Users\Win10>flutter doctor
CreateProcessW failed 193
CreateProcessW failed 193
CreateProcessW failed 193
Unhandled exception:
ProcessException: %1 is not a valid Win32 application.
Command: C:\Program Files\Git\cmd\git.EXE log -n 1 --pretty=format:%H
#0 _ProcessImpl._runAndWait (dart:io-patch/process_patch.dart:489:7)
#1 _runNonInteractiveProcessSync (dart:io-patch/process_patch.dart:634:18)
#2 Process.runSync (dart:io-patch/process_patch.dart:66:12)
#3 LocalProcessManager.runSync (package:process/src/interface/local_process_manager.dart:83:20)
#4 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:343:48)
#5 runSync (package:flutter_tools/src/base/process.dart:315:10)
#6 _runGit (package:flutter_tools/src/version.dart:532:10)
#7 new FlutterVersion (package:flutter_tools/src/version.dart:23:26)
#8 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:81:29)
#9 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
#10 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)
#11 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
#12 AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
#13 FlutterVersion.instance (package:flutter_tools/src/version.dart:183:49)
#14 new Usage (package:flutter_tools/src/usage.dart:60:58)
#15 runInContext.<anonymous closure> (package:flutter_tools/src/context_runner.dart:101:20)
#16 AppContext._generateIfNecessary.<anonymous closure> (package:flutter_tools/src/base/context.dart:99:41)
#17 __InternalLinkedHashMap&_HashVMBase&MapMixin&_LinkedHashMapMixin.putIfAbsent (dart:collection-patch/compact_hash.dart:281:23)
#18 AppContext._generateIfNecessary (package:flutter_tools/src/base/context.dart:87:20)
#19 AppContext.get (package:flutter_tools/src/base/context.dart:115:32)
#20 Usage.instance (package:flutter_tools/src/usage.dart:84:40)
#21 flutterUsage (package:flutter_tools/src/usage.dart:54:33)
#22 _handleToolError (package:flutter_tools/runner.dart:112:7)
<asynchronous suspension>
#23 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:69:13)
<asynchronous suspension>
#24 _rootRunBinary (dart:async/zone.dart:1148:13)
#25 _CustomZone.runBinary (dart:async/zone.dart:1037:19)
#26 runZoned.<anonymous closure> (dart:async/zone.dart:1479:21)
#27 _CustomZone.handleUncaughtError (dart:async/zone.dart:1003:19)
#28 Future._propagateToListeners (dart:async/future_impl.dart:589:16)
#29 Future._completeError (dart:async/future_impl.dart:491:5)
#30 _SyncCompleter._completeError (dart:async/future_impl.dart:55:12)
#31 _Completer.completeError (dart:async/future_impl.dart:27:5)
#32 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:40:18)
#33 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart)
<asynchronous suspension>
#34 _rootRun (dart:async/zone.dart:1124:13)
#35 _CustomZone.run (dart:async/zone.dart:1021:19)
#36 _runZoned (dart:async/zone.dart:1516:10)
#37 runZoned (dart:async/zone.dart:1500:12)
#38 run.<anonymous closure> (package:flutter_tools/runner.dart:60:18)
<asynchronous suspension>
#39 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#40 _rootRun (dart:async/zone.dart:1124:13)
#41 _CustomZone.run (dart:async/zone.dart:1021:19)
#42 _runZoned (dart:async/zone.dart:1516:10)
#43 runZoned (dart:async/zone.dart:1463:12)
#44 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#45 runInContext (package:flutter_tools/src/context_runner.dart:56:24)
<asynchronous suspension>
#46 run (package:flutter_tools/runner.dart:51:10)
#47 main (package:flutter_tools/executable.dart:62:9)
<asynchronous suspension>
#48 main (file:///C:/src/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#49 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#50 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:12)
Found https://github.com/flutter/flutter/issues/19805#issuecomment-478306166 and Flutter with installation error for %1 is not a valid win32 application, but I have follow what those research say , but none of those help
It seems you have not pasted the PATH in Environment Variables Account.
You have to take the flutter(Extracted folder), and paste the path upto flutter/bin
in the Edit Path table.
then try running flutter doctor from the folder(in terminal) where you have your flutter folder
I try to build and run flutter for desktop and I get the bellow error when I use ~/dev/flutter/bin/flutter run -v
Objects-normal/x86_64/GeneratedPluginRegistrant~partial.swiftmodule -emit-dependencies-path
/Users/myuser/tmp/flutter-desktop-embedding/example/build/macos/Build/Intermediates.noindex/Runner.build/Debug/Runner.build/
Objects-normal/x86_64/GeneratedPluginRegistrant.d -emit-reference-dependencies-path
/Users/myuser/tmp/flutter-desktop-embedding/example/build/macos/Build/Intermediates.noindex/Runner.build/Debug/Runner.build/
Objects-normal/x86_64/GeneratedPluginRegistrant.swiftdeps -o
/Users/myuser/tmp/flutter-desktop-embedding/example/build/macos/Build/Intermediates.noindex/Runner.build/Debug/Runner.build/
Objects-normal/x86_64/GeneratedPluginRegistrant.o
[ +27 ms] ** BUILD FAILED **
[ +3 ms] The following build commands failed:
[ ] CompileSwift normal x86_64 /Users/myuser/tmp/flutter-desktop-embedding/example/macos/ExampleWindow.swift
[ ] CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
[ ] (2 failures)
[ +16 ms] Building macOS application... (completed in 10.1s)
[ +10 ms] "flutter run" took 11,052ms.
Build process failed
#0 throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1 buildMacOS (package:flutter_tools/src/macos/build_macos.dart:85:5)
<asynchronous suspension>
#2 MacOSDevice.startApp (package:flutter_tools/src/macos/macos_device.dart:86:13)
<asynchronous suspension>
#3 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:378:54)
<asynchronous suspension>
#4 HotRunner.run (package:flutter_tools/src/run_hot.dart:254:39)
<asynchronous suspension>
#5 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:472:37)
<asynchronous suspension>
#6 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:490:18)
#7 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#8 _rootRunUnary (dart:async/zone.dart:1132:38)
#9 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#10 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#11 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#12 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#13 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#14 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#15 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#16 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#17 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#18 _rootRunUnary (dart:async/zone.dart:1132:38)
#19 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#20 _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#21 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#22 Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#23 Future._completeWithValue (dart:async/future_impl.dart:522:5)
#24 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#25 _rootRun (dart:async/zone.dart:1124:13)
#26 _CustomZone.run (dart:async/zone.dart:1021:19)
#27 _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#28 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#29 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#30 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#31 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#32 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)
This is how i setup the desktop:
~/dev/flutter/bin/flutter channel master
~/dev/flutter/bin/flutter upgrade
~/dev/flutter/bin/flutter doctor
export ENABLE_FLUTTER_DESKTOP=true
~/dev/flutter/bin/flutter devices
~/dev/flutter/bin/flutter packages get
~/dev/flutter/bin/flutter precache --macos
The example i'm trying to run:
https://github.com/google/flutter-desktop-embedding.git