adjust / flutter_sdk

This is the Flutter SDK of
MIT License
59 stars 49 forks source link

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

Closed CedYF closed 3 years ago

CedYF commented 4 years ago

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.

uerceg commented 4 years ago

Hi @CedYF

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

CedYF commented 4 years ago

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 commented 4 years ago

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

boatengyeboah commented 3 years ago

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

uerceg commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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) #2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12) #3 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1009:27) #4 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #6 CommandRunner.runCommand (package:args/command_runner.dart:197:13) #7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:278:9) #8 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5) #11 run.. (package:flutter_tools/runner.dart:64:9) #12 run. (package:flutter_tools/runner.dart:62:12) #13 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12) #15 runInContext (package:flutter_tools/src/context_runner.dart:73:10) #16 main (package:flutter_tools/executable.dart:90:3) [ +86 ms] ensureAnalyticsSent: 32ms [ +1 ms] Running shutdown hooks [ ] Shutdown hook priority 4 [ +1 ms] Shutdown hooks complete [ ] exiting with code 1 ```

bchhabra2490 commented 3 years ago

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 commented 3 years ago

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 https://github.com/lukasgit/flutter_contacts/issues/220#issuecomment-833532794. The issue above (compileReleaseAidl) was then resolved.

Could boil down to a Gradle Issue.

uerceg commented 3 years ago

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 commented 3 years ago

Hey guys (who are still facing the issue),

Any update on this one?

uerceg commented 3 years ago

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