Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILURE: Build failed with an exception. Flutter 2.0 #432

Closed
Yonkokilasi opened this issue Mar 8, 2021 · 30 comments
Closed

FAILURE: Build failed with an exception. Flutter 2.0 #432

Yonkokilasi opened this issue Mar 8, 2021 · 30 comments
Labels
Android Issues specific to the Android Platform auth Issues related to the Auth Category Build Issues related to building apps using Amplify flutter pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.

Comments

@Yonkokilasi
Copy link

Describe the bug
FAILURE: Build failed with an exception.

  • Where:

Build file '*/.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.1.0/android/build.gradle' line: 62

  • What went wrong:
    A problem occurred evaluating root project 'amplify_auth_cognito'.

Cannot convert a null value to an object of type Dependency.
The following types/formats are supported:
- Instances of Dependency.
- String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
- Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
- FileCollections, for example files('some.jar', 'someOther.jar').
- Projects, for example project(':some:project:path').
- ClassPathNotation, for example gradleApi().

Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

  • 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.

To Reproduce
Steps to reproduce the behavior:

  1. Run flutter build apk --release // flutter build apk
  2. Make sure you are running Flutter 2.0
  3. You will see the error posted above in the output

Expected behavior
I am able to build an apk successfully

Screenshots
If applicable, add screenshots to help explain your problem.

Platform
Amplify Flutter current supports iOS and Android. This issue is reproducible in (check all that apply):

  • Android
  • iOS
@Amplifiyer
Copy link
Contributor

@Yonkokilasi can you post your flutter doctor -v output here?

@Yonkokilasi
Copy link
Author

Yonkokilasi commented Mar 11, 2021

@Yonkokilasi can you post your flutter doctor -v output here?

[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.2 20D80 darwin-x64, locale en-GB)
• Flutter version 2.0.1 at /Users/?/?/flutter
• Framework revision c5a4b4029c (7 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/?/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.54.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0

[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 88.0.4324.192

! Doctor found issues in 1 category.

@Amplifiyer
Copy link
Contributor

@Yonkokilasi thanks for the details. My setup is exactly the same as yours and I am able to build apps (android release) that have amplify_auth_cognito as dependency with flutter 2.0. Will it be possible for you to host a minimal reproducible app on github where we can pull down and reproduce this issue?

@trinanda98
Copy link

Hi @Amplifiyer @Yonkokilasi has anyone found the solution yet? We're also facing this exact problem and it came out of nowhere. We were able to run it two days ago (Sunday), and hasn't done anything to the code ever since.

Screenshot (8)

Screenshot (9)

Flutter doctor result is fine

[√] Flutter (Channel beta, 2.0.1, on Microsoft Windows [Version 10.0.19042.867], locale en-US)
• Flutter version 2.0.1 at C:\flutter\flutter
• Framework revision c5a4b4029c (11 days ago), 2021-03-04 09:47:48 -0800
• Engine revision 40441def69
• Dart version 2.12.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\trina\AppData\Local\Android\Sdk
• Platform android-30, build-tools 29.0.3
• ANDROID_SDK_ROOT = C:\Users\trina\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] VS Code (version 1.54.3)
• VS Code at C:\Users\trina\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.20.0

[√] Connected device (3 available)
• POCO F2 Pro (mobile) • 36572c01 • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.82
• Edge (web) • edge • web-javascript • Microsoft Edge 88.0.705.63

• No issues found!

@Amplifiyer
Copy link
Contributor

It looks like that jcenter was down yesterday during the time you ran into this issue https://status.bintray.com/
Can you try again and let us know if it's resolved on its own?

@bobosette
Copy link

I don't know if this can be useful....but i faced this problem 20 minutes ago (with flutter 1.22) and i fixed it by changing on the build.gradle the minSdkVersion (from 16 to 21)

@ken-ng-esotec
Copy link

im facing this issue too, any support on this please?

@Yonkokilasi
Copy link
Author

Yonkokilasi commented Mar 24, 2021

I don't know if this can be useful....but i faced this problem 20 minutes ago (with flutter 1.22) and i fixed it by changing on the build.gradle the minSdkVersion (from 16 to 21)

The minSDK is already 21

`group 'com.amazonaws.amplify.amplify_auth_cognito'
version '1.0-SNAPSHOT'

.....

android {
    compileSdkVersion 28

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
        test.java.srcDirs += 'src/test/kotlin'
        test.resources.srcDirs += '../test/resources'
    }
    defaultConfig {
        minSdkVersion 21
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    testOptions {
        unitTests {
            includeAndroidResources = true
        }
    }
    buildTypes {
        debug {
            testCoverageEnabled = true
        }
    }
}

.....
`

@Yonkokilasi
Copy link
Author

@Yonkokilasi thanks for the details. My setup is exactly the same as yours and I am able to build apps (android release) that have amplify_auth_cognito as dependency with flutter 2.0. Will it be possible for you to host a minimal reproducible app on github where we can pull down and reproduce this issue?

This will not be possible

@Yonkokilasi
Copy link
Author

Yonkokilasi commented Mar 24, 2021

A new error is now showing @Amplifiyer

FAILURE: Build failed with an exception.

* Where:
Build file '.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.1.0/android/build.gradle' line: 62

* What went wrong:
A problem occurred evaluating root project 'amplify_auth_cognito'.
> Cannot convert a null value to an object of type Dependency.
  The following types/formats are supported:
    - Instances of Dependency.
    - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
    - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, for example files('some.jar', 'someOther.jar').
    - Projects, for example project(':some:project:path').
    - ClassPathNotation, for example gradleApi().

  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

* 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 4s


Exception: The plugin amplify_auth_cognito could not be built due to the issue above.

@SalahAdDin
Copy link

A new error is now showing @Amplifiyer

FAILURE: Build failed with an exception.

* Where:
Build file '.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.1.0/android/build.gradle' line: 62

* What went wrong:
A problem occurred evaluating root project 'amplify_auth_cognito'.
> Cannot convert a null value to an object of type Dependency.
  The following types/formats are supported:
    - Instances of Dependency.
    - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
    - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, for example files('some.jar', 'someOther.jar').
    - Projects, for example project(':some:project:path').
    - ClassPathNotation, for example gradleApi().

  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

* 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 4s


Exception: The plugin amplify_auth_cognito could not be built due to the issue above.

It is a conflict with the new Flutter's version.

@WingCH
Copy link

WingCH commented Apr 2, 2021

same problem

@PriyaSindkar
Copy link

A new error is now showing @Amplifiyer

FAILURE: Build failed with an exception.

* Where:
Build file '.pub-cache/hosted/pub.dartlang.org/amplify_auth_cognito-0.1.0/android/build.gradle' line: 62

* What went wrong:
A problem occurred evaluating root project 'amplify_auth_cognito'.
> Cannot convert a null value to an object of type Dependency.
  The following types/formats are supported:
    - Instances of Dependency.
    - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
    - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, for example files('some.jar', 'someOther.jar').
    - Projects, for example project(':some:project:path').
    - ClassPathNotation, for example gradleApi().

  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

* 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 4s


Exception: The plugin amplify_auth_cognito could not be built due to the issue above.

facing the same issue with Flutter SDK 2.0.3

@samuelchanx
Copy link

Same problem

@CamronLDNF
Copy link

Same here

@Ashish-Nanda Ashish-Nanda added auth Issues related to the Auth Category Build Issues related to building apps using Amplify flutter Android Issues specific to the Android Platform labels May 15, 2021
@raphire08
Copy link

same problem. Is there any solution?

@haverchuck
Copy link
Contributor

haverchuck commented May 27, 2021

Could somebody please post a pubspec file and an android/build.gradle file for an app that is reproducing this behavior (obviously with any sensitive info redacted)?

@fdarsot
Copy link

fdarsot commented May 28, 2021

having the same issue

@fdarsot
Copy link

fdarsot commented May 28, 2021

So i was able to resolve (resolve isnt really the right word) but i was able to figure out that one of the other packages i was using in my pubspec.yaml file was interfering with this package.

once i removed it, all was well again.

bad news is i need to find another package to use for that one i just took out.

@raphire08
Copy link

raphire08 commented May 28, 2021 via email

@fdarsot
Copy link

fdarsot commented May 28, 2021

@raphire08
Copy link

@haverchuck

Please find pubsepc and android.build. Apologies for word document.

pubspec.docx
build_gradle.docx

@raphire08
Copy link

@haverchuck

I did some changes and it worked, but I don't know which one did the resolution

  1. updated the Kotlin_version in build.gradle to 1.3.72
  2. updated the classpath 'com.android.tools.build:gradle:4.1.3'
  3. updated grade version to 6.5
  4. target SDK 30 (min SDKVerion was already 21)

Was able to build successfully then for amplify_flutter ^0.1.4 and amplify_auth_cognito ^0.1.4

@ollija
Copy link

ollija commented Jul 8, 2021

Having this issue

@cshfang
Copy link
Contributor

cshfang commented Jul 9, 2021

@ollija would it be possible to share a minimal project where you find this to be reproducible? Any additional information about the current state of your project (pubspec.yaml, build.gradle, etc) would be helpful. The original issue was opened against amplify flutter version 0.1.0 and the latest released version is 0.2.0 so I'm wondering (hoping?) that maybe the issue was fixed somewhere in between.

@ikartikgautam
Copy link

Even i am facing same issue

@epomeranz
Copy link

I'm having the same issue on the flutter's amplify example project: https://github.com/aws-amplify/amplify-flutter

Any suggestions?

@raaone7
Copy link

raaone7 commented Aug 5, 2021

all I had similar issue, adding
amplify_core: ^0.2.2 in pubspec.yaml
solved the problem , worth trying it out

@genjm
Copy link

genjm commented Aug 26, 2021

I get this error message when I update my styles.xml files to use AppCompat themes instead of the normal ones, as soon as I switch back, the error goes away & the app builds fine.

Obviously this doesn't really help me, as I need the AppCompat themes to use the local_auth package but hopefully it might help you get to the bottom of the problem & fix it.

@offlineprogrammer
Copy link
Contributor

Hi All

Is anyone still facing the issue with the latest release

Regards
Mo

@offlineprogrammer offlineprogrammer added the pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days. label Jan 6, 2022
@offlineprogrammer offlineprogrammer added this to Pending Triage in Issues Triaging via automation Jan 6, 2022
@offlineprogrammer offlineprogrammer moved this from Pending Triage to Can't Reproduce / Pending Response in Issues Triaging Jan 6, 2022
Issues Triaging automation moved this from Can't Reproduce / Pending Response to Closed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Issues specific to the Android Platform auth Issues related to the Auth Category Build Issues related to building apps using Amplify flutter pending-close-response-required The issue will be closed if details necessary to reproduce the issue are not provided within 7 days.
Projects
No open projects
Development

No branches or pull requests