Error build Flutter Appbundle

‘flutter build appbundle’ results in:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:packageReleaseBundle’.

1 exception was raised by workers:
com.android.tools.build.bundletool.exceptions.BundleFileTypesException$FileUsesReservedNameException: File ‘root/lib/x86_64/darwin/libscrypt.dylib’ uses reserved file or directory name ‘lib’.

  • 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

Upgrading gradle to latest version didn’t help. How can I fix this?

I have a similar error. When I execute “flutter build appbundle”, I see this output:

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘/Users/peterbaldwin/Workspace/AprumProjects/aprum_shop/android/app/build.gradle’ line: 59

  • What went wrong:
    A problem occurred evaluating project ‘:app’.

path may not be null or empty string. path=‘null’