Flutter - A problem occurred configuring project ':amplify_auth_cognito_android'

Viewed 54

When i try to build flutter App Showing this Error

Plugins

  amplify_auth_cognito: ^0.6.3
  amplify_flutter: ^0.6.3
  amplify_storage_s3: ^0.6.3

My Config Code


  void configureAmplify() async {
    // First add plugins (Amplify native requirements)
    AmplifyStorageS3 storage = AmplifyStorageS3();
    AmplifyAuthCognito auth = AmplifyAuthCognito();
    Amplify.addPlugins([auth, storage]);
    try {
      // Configure
      await Amplify.configure(amplifyconfig);
    } on AmplifyAlreadyConfiguredException {
      print(
          'Amplify was already configured. Looks like app restarted on android.');
    }

    setState(() {
      _isAmplifyConfigured = true;
    });
    debugPrint('Amplify Status ${_isAmplifyConfigured.toString()}');
  }

Full Error :

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':amplify_auth_cognito_android'.
> this and base files have different roots: F:\flutter\anuj\merjee\build\amplify_auth_cognito_android and C:\sdk\flutter\.pub-cache\hosted\pub.dartlang.org\amplify_auth_cognito_android-0.6.3\android.
* 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.
Launching lib\main.dart on Infinix X662B in debug mode...
lib\main.dart:1

* Get more help at https://help.gradle.org

BUILD FAILED in 3s
Exception: Gradle task assembleDebug failed with exit code 1

My Aws Install Success but showing this error when i try to run the app i want to used Aws S3 to upload my User Post Image in Aws Server amplify folder created success everything fine but showing this error

1 Answers

This is a problem with flutter itself. Try moving your project to the same drive as flutter is in. This should resolve this issue.

Check this GitHub issue for more information.

Related