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"
Related
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.
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.
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
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
I know there's a lot of information around the web and I've read all the posts and articles I found on the web and still can't figure it out and google documentation about the errors is very bad. Many people complains about it but I don't see any obvious fix and most people are using debug and development mode to avoid this setup.
I've created a flutter app that needs to make Google Sign In and of course, it don't work.
1) I've created the firebase project, activated the android app project, placed the SHA1 release and the .json on the project.
2) I've followed the flutter docs to release the app (key.properties, changing the signingConfigs and that stuff. App it's not on the Play Store, I'm testing on my phone.
2.1) keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
3) Flutter dependencies:
firebase_auth: 0.7.0
google_sign_in: 3.2.4
cloud_firestore: 0.8.2+3
fluttertoast: ^2.0.7
image_picker: 0.4.12+1
shared_preferences: 0.4.3
firebase_storage: 1.0.4
cached_network_image: ^0.7.0
intl: ^0.15.7
firebase_core: ^0.2.5
4) I'm using the new GoogleAuthProvider.getCredential and not the old SignInWithGoogle
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
);
4.1) Built build\app\outputs\apk\debug\app-debug.apk.
5) When I press login I get this errors:
E/flutter (23045): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
E/flutter (23045): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (23045): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter (23045): <asynchronous suspension>
E/flutter (23045): #2 GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:217:58)
E/flutter (23045): <asynchronous suspension>
E/flutter (23045): #3 GoogleSignIn._addMethodCall (package:google_sign_in/google_sign_in.dart:256:20)
E/flutter (23045): #4 GoogleSignIn.signIn (package:google_sign_in/google_sign_in.dart:324:48)
E/flutter (23045): #5 _LoginScreenState._handleSignIn (package:flikmechat/login_signup.dart:69:57)
E/flutter (23045): <asynchronous suspension>
E/flutter (23045): #6 _LoginScreenState._loginPage.<anonymous closure> (package:flikmechat/login_signup.dart:566:52)
E/flutter (23045): <asynchronous suspension>
E/flutter (23045): #7 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:511:14)
E/flutter (23045): #8 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:566:30)
E/flutter (23045): #9 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter (23045): #10 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter (23045): #11 TapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:211:7)
E/flutter (23045): #12 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27)
E/flutter (23045): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:225:20)
E/flutter (23045): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter (23045): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (23045): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (23045): #17 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (23045): #18 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (23045): #19 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (23045): #20 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (23045): #21 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter (23045): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
Please advise, I really don't know what to do. Thank you so much.
I resolved by adding the Sha1 debug key on firebase.
I thought that placing the release Sha1 was enough but it's not since when we test on mobile it uses the apk debug.
Hope this help someone.
Plenty can go wrong, as I explained in my answer to this question: Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
Make sure to have your set in your firebase project settings: