Skip to content

Critical: Can't build with apk with Adjust #18

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

Closed
CedYF opened this issue Jun 16, 2020 · 14 comments
Closed

Critical: Can't build with apk with Adjust #18

CedYF opened this issue Jun 16, 2020 · 14 comments

Comments

@CedYF
Copy link

CedYF commented Jun 16, 2020

When I try building the apk I get this error message that the build grade is not supported. When I manually change the gradle to 6.1.1 it also fails.

I can't release my app anymore without it crashing.

Error Message below:

FAILURE: Build failed with an exception.

  • Where:
    Build file '/Users/cedricyarish/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.22.0/android/build.gradle' line: 25

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

Failed to apply plugin [id 'com.android.internal.version-check']
Minimum supported Gradle version is 6.1.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in /Users/cedricyarish/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.22.0/android/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip

  • 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.
@uerceg
Copy link
Contributor

uerceg commented Jun 16, 2020

Hi @CedYF

Thanks for reporting this. Can you reproduce this issue on new empty Flutter app and send it over?

@CedYF
Copy link
Author

CedYF commented Jun 16, 2020

I'll see if I can try this tomorrow. Right now it's just when I run flutter build apk. I'm trying the usual restarting, flutter clean, upgrades etc...

@uerceg
Copy link
Contributor

uerceg commented Jun 16, 2020

👍 I see. Still if you manage to reproduce this in dummy example app, would be great if we can get it.

@boatengyeboah
Copy link

Running into this issue too, is there a fix yet?

@uerceg
Copy link
Contributor

uerceg commented Dec 28, 2020

Hi @boatengyeboah

Are you able to reproduce this in example app and send it over? Also, which Gradle version are you using? What have you set in your app in here and here?

@uerceg
Copy link
Contributor

uerceg commented Feb 22, 2021

Hey guys,

Any update in here? Did you manage to get this solved? Also in case not, is it still the case with latest SDK version?

Cheers

@tomk9
Copy link

tomk9 commented Feb 23, 2021

I updated to 4.26.0. Now have different error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/local.properties'.

* 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 5m 31s

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

@uerceg
Copy link
Contributor

uerceg commented Feb 23, 2021

Wow. That's strange. Not even I have that environment variable set up. Can you send output of flutter doctor -v command? Did you try cleaning project first?

@tomk9
Copy link

tomk9 commented Mar 10, 2021

Of course I cleaned project.

flutter doctor -v

flutter doctor -v
[✓] Flutter (Channel stable, 2.0.1, on macOS 11.2.3 20D91 darwin-x64, locale
    en-PL)
    • Flutter version 2.0.1 at /Users/tomasz/development/flutter
    • Framework revision c5a4b4029c (6 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/tomasz/Library/Android/sdk
    • Platform android-S, 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)
    • All Android licenses accepted.

[✓] 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 (4 available)
    • Lenovo K3 Note (mobile)  • 4GSARGZAPKD6FUCY          • android-arm64  •
      Android 7.1.2 (API 25)
    • Tomasz’s iPhone (mobile) • 00008040-000F17450D94803D • ios            •
      iOS 14.4.1
    • macOS (desktop)          • macos                     • darwin-x64     •
      macOS 11.2.3 20D91 darwin-x64
    • Chrome (web)             • chrome                    • web-javascript •
      Google Chrome 89.0.4389.82

• No issues found!

flutter run --flavor=production --release --verbose

flutter run --flavor=production --release --verbose
...
[  +11 ms] executing: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java -version
[  +73 ms] Exit code 0 from: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java -version
[        ] openjdk version "1.8.0_242-release"
           OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
           OpenJDK 64-Bit Server VM (build 25.242-b3-6915495, mixed mode)
[   +3 ms] executing: [/Users/tomasz/fla/mobile-app/android/] /Users/tomasz/fla/mobile-app/android/gradlew -Pverbose=true -Ptarget-platform=android-arm64 -Ptarget=/Users/tomasz/fla/mobile-app/lib/main.dart -Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root assembleProductionRelease
[ +478 ms] Welcome to Gradle 5.6.4!
[        ] Here are the highlights of this release:
[        ]  - Incremental Groovy compilation
[        ]  - Groovy compile avoidance
[        ]  - Test fixtures for Java projects
[        ]  - Manage plugin versions via settings script
[        ] For more details see https://docs.gradle.org/5.6.4/release-notes.html
[ +294 ms] > Configure project :app
[        ] WARNING: The option 'android.enableR8' is deprecated and should not be used anymore.
[        ] It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
[        ] WARNING: API 'variant.getMappingFile()' is obsolete and has been replaced with 'variant.getMappingFileProvider()'.
[        ] It will be removed at the end of 2019.
[        ] For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
[        ] To determine what is calling variant.getMappingFile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
[ +397 ms] FAILURE: Build failed with an exception.
[   +2 ms] * What went wrong:
[        ] Could not determine the dependencies of task ':app:lintVitalProductionRelease'.
[        ] > Could not resolve all artifacts for configuration ':app:developmentDebugAndroidTestRuntimeClasspath'.
[        ]    > Could not resolve androidx.test.espresso:espresso-idling-resource:{strictly 3.1.0-alpha3}.
[        ]      Required by:
[        ]          project :app
[        ]       > Cannot find a version of 'androidx.test.espresso:espresso-idling-resource' that satisfies the version constraints: 
[        ]            Dependency path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-core:3.3.0' --> 'androidx.test.espresso:espresso-idling-resource:3.3.0'
[        ]            Constraint path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-idling-resource:{strictly 3.1.0-alpha3}' because of the following reason: developmentDebugRuntimeClasspath uses version 3.1.0-alpha3
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:core-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:mobile-engage-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ]    > Could not resolve androidx.test.espresso:espresso-idling-resource:3.3.0.
[        ]      Required by:
[        ]          project :app > androidx.test.espresso:espresso-core:3.3.0
[        ]       > Cannot find a version of 'androidx.test.espresso:espresso-idling-resource' that satisfies the version constraints: 
[        ]            Dependency path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-core:3.3.0' --> 'androidx.test.espresso:espresso-idling-resource:3.3.0'
[        ]            Constraint path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-idling-resource:{strictly 3.1.0-alpha3}' because of the following reason: developmentDebugRuntimeClasspath uses version 3.1.0-alpha3
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:core-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:mobile-engage-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ]    > Could not resolve androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3.
[        ]      Required by:
[        ]          project :app > com.emarsys:core-api:2.12.1
[        ]          project :app > com.emarsys:mobile-engage-api:2.12.1
[        ]       > Cannot find a version of 'androidx.test.espresso:espresso-idling-resource' that satisfies the version constraints: 
[        ]            Dependency path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-core:3.3.0' --> 'androidx.test.espresso:espresso-idling-resource:3.3.0'
[        ]            Constraint path 'android:app:unspecified' --> 'androidx.test.espresso:espresso-idling-resource:{strictly 3.1.0-alpha3}' because of the following reason: developmentDebugRuntimeClasspath uses version 3.1.0-alpha3
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:core-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ]            Dependency path 'android:app:unspecified' --> 'com.emarsys:emarsys-sdk:2.12.1' --> 'com.emarsys:mobile-engage-api:2.12.1' --> 'androidx.test.espresso:espresso-idling-resource:3.1.0-alpha3'
[        ] * 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 1s
[ +440 ms] Running Gradle task 'assembleProductionRelease'... (completed in 1,722ms)
[   +2 ms] The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
[   +5 ms] Building plugin adjust_sdk...
[   +3 ms] Running Gradle task 'assembleAarRelease'...
[   +1 ms] Using gradle from /Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/gradlew.
[        ] /Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/gradlew mode: 33261 rwxr-xr-x.
[        ] executing: [/Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/] /Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/gradlew -I=/Users/tomasz/development/flutter/packages/flutter_tools/gradle/aar_init_script.gradle
-Pflutter-root=/Users/tomasz/development/flutter -Poutput-dir=/Users/tomasz/fla/mobile-app/build/app -Pis-plugin=true -PbuildNumber=1.0 -Pverbose=true -Ptarget-platform=android-arm,android-arm64,android-x64 assembleAarRelease
[ +793 ms] 
                    Welcome to Gradle 6.5!

                    Here are the highlights of this release:
                     - Experimental file-system watching
                     - Improved version ordering
                     - New samples

                    For more details see https://docs.gradle.org/6.5/release-notes.html


                    Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
                    Use '--warning-mode all' to show the individual deprecation warnings.
                    See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings


                    FAILURE: Build failed with an exception.

                    * What went wrong:
                    Could not determine the dependencies of task ':compileReleaseAidl'.
                    > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/local.properties'.

                    * 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 625ms
[        ] Running Gradle task 'assembleAarRelease'... (completed in 796ms)
[        ] 
           Welcome to Gradle 6.5!
           
           Here are the highlights of this release:
            - Experimental file-system watching
            - Improved version ordering
            - New samples
           
           For more details see https://docs.gradle.org/6.5/release-notes.html
           
           
           Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
           Use '--warning-mode all' to show the individual deprecation warnings.
           See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
           
[        ] 
           FAILURE: Build failed with an exception.
           
           * What went wrong:
           Could not determine the dependencies of task ':compileReleaseAidl'.
           > SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/tomasz/development/flutter/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.26.0/android/local.properties'.
           
           * 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 625ms
           
[   +7 ms] Exception: The plugin adjust_sdk could not be built due to the issue above.
[        ] "flutter run" took 6,692ms.
[   +5 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
           <asynchronous suspension>
           #2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
           <asynchronous suspension>
           #3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
           <asynchronous suspension>
           #4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #5      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #10     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
           <asynchronous suspension>
           #11     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
           <asynchronous suspension>
           #12     run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
           <asynchronous suspension>
           #13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #14     AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
           <asynchronous suspension>
           #15     runInContext (package:flutter_tools/src/context_runner.dart:73:10)
           <asynchronous suspension>
           #16     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>
           
           
[  +86 ms] ensureAnalyticsSent: 32ms
[   +1 ms] Running shutdown hooks
[        ] Shutdown hook priority 4
[   +1 ms] Shutdown hooks complete
[        ] exiting with code 1

@bchhabra2490
Copy link

Any update? Facing the same issue.

* What went wrong:
Could not determine the dependencies of task ':compileReleaseAidl'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/bharatchhabra/.pub-cache/hosted/pub.dartlang.org/adjust_sdk-4.28.0/android/local.properties'.

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


The plugin adjust_sdk could not be built due to the issue above.

@chillbrodev
Copy link

Not sure if this is related to anyone else's issue. I am using https://pub.dev/packages/contacts_service in my code and it had an issue with resolving the new queries manifest tag. So I updated Gradle as noted in this link lukasgit/flutter_contacts#220 (comment). The issue above (compileReleaseAidl) was then resolved.

Could boil down to a Gradle Issue.

@uerceg
Copy link
Contributor

uerceg commented Jul 6, 2021

Hey @chillbrodev, thanks for this observation. I think that Gradle version topic was where I was going with this comment.

I would also be curious to hear if Gradle version update solves the issue for those who are facing it right now.

@uerceg
Copy link
Contributor

uerceg commented Aug 22, 2021

Hey guys (who are still facing the issue),

Any update on this one?

@uerceg
Copy link
Contributor

uerceg commented Aug 30, 2021

In case this is still an issue for you guys, please feel free to comment/reopen. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants