Home > Mobile >  Flutter application crashing after branch change
Flutter application crashing after branch change

Time:07-13

We changed our branch yesterday and the app isn't running on the new branch. It gives me an error:

Launching lib/main.dart on Redmi Note 9 Pro in debug mode...
/home/aman/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/android/src/main/java/com/baseflow/permissionhandler/ServiceManager.java:75: warning: [deprecation] queryIntentActivities(Intent,int) in PackageManager has been deprecated
            List<ResolveInfo> callAppsList = pm.queryIntentActivities(callIntent, 0);
                                               ^
error: warnings found and -Werror specified
/home/aman/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/android/src/main/java/com/baseflow/permissionhandler/PermissionUtils.java:317: warning: [deprecation] getPackageInfo(String,int) in PackageManager has been deprecated
                    .getPackageInfo(context.getPackageName(), PackageManager.GET_PERMISSIONS);
                    ^
1 error
2 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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 1m 5s
Running Gradle task 'assembleDebug'...                             66.7s
Exception: Gradle task assembleDebug failed with exit code 1

I dont think the branch change is any problem in this. I have no idea tho what its saying.

CodePudding user response:

It states that your permission handler is using a deprecated package. If you are using an older version of flutter upgrade the permission handler in pubspec to 9.0.0 or if you are using flutter 3 use the latest version and try again. As a first try you can change the version of permission handler in pubspec to any

permission_handler: any

And try if it works

  • Related