Gradle task assembleDebug failed with exit code 1 - android

I migrated my project to androidX and added in the pubspec file,
fluttery_audio: ^ 0.0.4
and I encountered this error How can I solve it?
this is the log of flutter run -v
Gradle task assembleDebug failed with exit code 1
#0 throwToolExit (package:flutter_tools/src/base/common.dart:24:3)
#1 _buildGradleProjectV2 (package:flutter_tools/src/android/gradle.dart:509: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 AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:422:13)
<asynchronous suspension>
#5 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:371:54)
<asynchronous suspension>
#6 HotRunner.run (package:flutter_tools/src/run_hot.dart:253:39)
<asynchronous suspension>
#7 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:489:37)
<asynchronous suspension>
#8 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:508:18)
<asynchronous suspension>
#9 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:413:33)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#11 _rootRun (dart:async/zone.dart:1124:13)
#12 _CustomZone.run (dart:async/zone.dart:1021:19)
#13 _runZoned (dart:async/zone.dart:1516:10)
#14 runZoned (dart:async/zone.dart:1463:12)
#15 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>

You're either using an old version of fluttery_audio, or your project has not been correctly migrated to AndroidX, I manually migrated mine when I had a similar error. Use this https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility . Hope that helps

Related

ProcessException: Process exited abnormally: Starting: Intent {...MainActivity (has extras) }

Unable to install app in Android 12 but it is working in android 11 after i updated target sdk to 31.
I have added andriod:exported to all the activites which uses intent filter after that if i run the app. it gives the below error.
not sure about the error what it is saying how can i fix it. please check
ProcessException: Process exited abnormally:
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x20000000 cmp= ..package name here.. .MainActivity (has extras) }
Exception occurred while executing 'start':
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x30000000 cmp=...package name here.. .MainActivity (has extras) } from null (pid=7644, uid=2000) not exported from uid 11272
at com.android.server.wm.ActivityTaskSupervisor.checkStartAnyActivityPermission(ActivityTaskSupervisor.java:1335)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1252)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:883)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1871)
at com.android.server.wm.ActivityTaskManagerService.startActivityAsUser(ActivityTaskManagerService.java:1742)
at com.android.server.am.ActivityManagerService.startActivityAsUserWithFeature(ActivityManagerService.java:3543)
at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:596)
at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:201)
at com.android.modules.utils.BasicShellCommandHandler.exec(BasicShellCommandHandler.java:97)
at android.os.ShellCommand.exec(ShellCommand.java:38)
at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:10429)
at android.os.Binder.shellCommand(Binder.java:986)
at android.os.Binder.onTransact(Binder.java:860)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:6049)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3034)
at android.os.Binder.execTransactInternal(Binder.java:1220)
at android.os.Binder.execTransact(Binder.java:1179)
Command: /Users/flipitnews/Library/Android/sdk/platform-tools/adb -s RZ8M22CVXEF shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x20000000 --ez enable-dart-profiling true com.flipitnews.finance/com.flipitnews.finance.flipitnews_flutter_app.MainActivity
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:123:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:275:19)
<asynchronous suspension>
#2 AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:677:28)
<asynchronous suspension>
#3 FlutterDevice.runCold (package:flutter_tools/src/resident_runner.dart:504:33)
<asynchronous suspension>
#4 ColdRunner.run (package:flutter_tools/src/run_cold.dart:57:28)
<asynchronous suspension>
#5 AppDomain.launch.<anonymous closure> (package:flutter_tools/src/commands/daemon.dart:641:9)
<asynchronous suspension>
#6 AppDomain.launch (package:flutter_tools/src/commands/daemon.dart:639:5)
<asynchronous suspension>
#7 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:596:15)
<asynchronous suspension>
#8 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
<asynchronous suspension>
#9 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#10 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
<asynchronous suspension>
#11 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#13 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
<asynchronous suspension>
#14 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:91:3)
<asynchronous suspension>
I opened my android folder separately, then moved to AndroidMainifest file
Android Studio suggest to set this to true in .MainActivity activity tag
android:exported="true"

keystore password was incorrect/Gradle task assembleRelease failed with exit code 1

Getting this error when building my APK:
A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
and
Gradle task assembleRelease failed with exit code 1
I've ensured that the password is correct.
Any ideas?
Running the latest stable version of flutter.
Thanks!
[ ] FAILURE: Build failed with an exception.
[ +1 ms] * What went wrong:
[ ] Execution failed for task ':app:packageRelease'.
[ ] > A failure occurred while executing
com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
[ ] > com.android.ide.common.signing.KeytoolException: Failed to read key key from store "C:\Users\redacted\Desktop\Fluxstore\android\app\key.jks": keystore password was incorrect
[ ] * 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 16s
[ +5 ms] Gradle task assembleRelease failed with exit code 1
[ ]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 buildGradleApp (package:flutter_tools/src/android/gradle.dart:411:7)
<asynchronous suspension>
#2 _AndroidBuilderImpl.buildApk (package:flutter_tools/src/android/android_builder.dart:101:7)
<asynchronous suspension>
#3 BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:103:5)
<asynchronous suspension>
#4 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#5 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#6 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#7 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#8 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#9 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#11 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#12 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#13 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#14 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#16 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#17 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#18 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
First please update your sdk (android, dart and flutter)
Next run flutter clean
Then run flutter build apk --split-per-abi
Tried that, didn't work out.
I finally got it working by removing Android Studio, SDK, & flutter completely and then reinstalling.
Also, my Android Studio had a whitespace in the installation file path. I installed it to the root drive, which may have helped.

Error on Flutter with the URL_Launcher package

Since yesterday, when I use a GestureDetector with the url_launcher package I'm getting this error:
E/flutter (17573): #0 _musicAreaState._launchURL (package:GiramosApp/ui/views/home_screen/widgets/music_area.dart:37:7)
E/flutter (17573): <asynchronous suspension>
E/flutter (17573): #1 _musicAreaState.build.<anonymous closure> (package:GiramosApp/ui/views/home_screen/widgets/music_area.dart:55:13)
E/flutter (17573): #2 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:183:24)
E/flutter (17573): #3 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:598:11)
E/flutter (17573): #4 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:287:5)
E/flutter (17573): #5 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:259:7)
E/flutter (17573): #6 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:157:27)
E/flutter (17573): #7 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:224:20)
E/flutter (17573): #8 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:200:22)
E/flutter (17573): #9 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:263:11)
E/flutter (17573): #10 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:157:7)
E/flutter (17573): #11 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:103:7)
E/flutter (17573): #12 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:87:7)
E/flutter (17573): #13 _rootRunUnary (dart:async/zone.dart:1206:13)
E/flutter (17573): #14 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
E/flutter (17573): #15 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1005:7)
E/flutter (17573): #16 _invoke1 (dart:ui/hooks.dart:265:10)
E/flutter (17573): #17 _dispatchPointerDataPacket (dart:ui/hooks.dart:174:5)
E/flutter (17573): ```
Any thoughts?
I found the error, I don't know why but it works deleting the async function. So, the result it's:
launchUrl(url) {
launch(url);
}
On iOS it works with the async flavour, but not on Android.
From API30 (Android 11) onwards, your Android app has to list all apps it interacts with.
Add this in your android manifest file (android > app > src > main > AndroidManifest.xml)
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>
Install the package properly using the steps given here. You should add a dependency of url_launcher in pubspec.yaml file. If you have done that,
To solve this issue you should clean the project using flutter clean, and then you upgrade your flutter using flutter upgrade. This will solve the problem for sure. If not, you create a new project and then paste the code in it.

Using foreground service in flutter

I am using this library to use forground service in a flutter app i am trying the sample app in the example of this package but i am getting error which i am not able to understand
Unhandled Exception: MissingPluginException(No implementation found for method foregroundServiceIsStarted on channel org.thebus.foreground_service/main)
E/flutter ( 9491): #0 MethodChannel._invokeMethod
(package:flutter/src/services/platform_channel.dart:154:7)
E/flutter ( 9491): <asynchronous suspension>
E/flutter ( 9491): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter ( 9491): #2 ForegroundService._invokeMainChannel (package:foreground_service/foreground_service.dart:21:33)
E/flutter ( 9491): #3 ForegroundService.foregroundServiceIsStarted (package:foreground_service/foreground_service.dart:133:18)
E/flutter ( 9491): #4 _MyAppState._toggleForegroundServiceOnOff (package:foregroundserviceflutter/main.dart:66:50)
E/flutter ( 9491): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
E/flutter ( 9491): #6 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862:36)
E/flutter ( 9491): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter ( 9491): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter ( 9491): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter ( 9491): #10 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:254:7)
E/flutter ( 9491): #11 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter ( 9491): #12 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter ( 9491): #13 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter ( 9491): #14 GestureBinding._handlePointerEvent
(package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 9491): #15 GestureBinding._flushPointerEventQueue
(package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 9491): #16 GestureBinding._handlePointerDataPacket
(package:flutter/src/gestures/binding.dart:86:7)
Any suggestion on what's going wrong in this
i have added the following plugin also – #Neelay Srivastava
MissingPluginException
what ever plugin you add it is not integrated in app although the plugin is get by pub
but not interacted in app for that you just have to quit app and build again

how to handle there is not installed twitter on your device exception when we are trying to login with twitter in flutter

I'm trying o create a flutter application. and I have success working with login with Facebook and Twitter. there is a problem while I'm trying to login with Twitter. My device has not been installed on the twitter application and I'm facing the problem for null value assign. Have anyone maid a solution for the issue.
E/flutter (20681): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'token' was called on null.
E/flutter (20681): Receiver: null
E/flutter (20681): Tried calling: token
E/flutter (20681): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
E/flutter (20681): #1 _LoginScreenState._loginWithTwitter (package:c2c_app/src/screens/Account/Login/login_page.dart:104:39)
E/flutter (20681): <asynchronous suspension>
E/flutter (20681): #2 _LoginScreenState._buildLoginWidget.<anonymous closure> (package:c2c_app/src/screens/Account/Login/login_page.dart:581:40)
E/flutter (20681): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706:14)
E/flutter (20681): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:789:36)
E/flutter (20681): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (20681): #6 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11)
E/flutter (20681): #7 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5)
E/flutter (20681): #8 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7)
E/flutter (20681): #9 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (20681): #10 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20)
E/flutter (20681): #11 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (20681): #12 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (20681): #13 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (20681): #14 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (20681): #15 _rootRunUnary (dart:async/zone.dart:1138:13)
E/flutter (20681): #16 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (20681): #17 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
E/flutter (20681): #18 _invoke1 (dart:ui/hooks.dart:273:10)
E/flutter (20681): #19 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
E/flutter (20681):
you need to just put try and catch block inside twitter login code

Categories

Resources