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

Sdk not found #76

Closed
davidAg9 opened this issue Oct 21, 2020 · 15 comments
Closed

Sdk not found #76

davidAg9 opened this issue Oct 21, 2020 · 15 comments

Comments

@davidAg9
Copy link

flutter version:1.22.2

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/username/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/android/local.properties'.

@plinkos
Copy link
Collaborator

plinkos commented Oct 23, 2020

Flutter just released this new version. We will need to upgrade the plug-in with the latest.

Sent with GitHawk

@davidAg9
Copy link
Author

we should I expect the your next version

@davidAg9 davidAg9 reopened this Oct 26, 2020
@davidAg9
Copy link
Author

is there a work around I really need to deploy my application

@davidAg9
Copy link
Author

I looked into the android folder in the package where the error was coming from and there appears to be no local.properties

@davidAg9
Copy link
Author

Here is a stacktrace

FAILURE: Build completed with 2 failures.

[ ] 1: Task failed with an exception.
[ ] -----------
[ ] * What went wrong:
[ ] Execution failed for task ':app:processReleaseResources'.
[ ] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[ ] > Android resource linking failed
[ ]
/Users/daveagyakwa/Desktop/repoflutter/projects/rokcare/build/file_picker/intermediates/library_manifest/release/AndroidManifest.xml:9:5-15:15: AAPT:
error: unexpected element found in .
[ ] * 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.
[ ] ==============================================================================
[ ] 2: Task failed with an exception.
[ ] -----------
[ ] * What went wrong:
[ ] Execution failed for task ':app:bundleReleaseResources'.
[ ] > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[ ] > Android resource linking failed
[ +62 ms]
/Users/daveagyakwa/Desktop/repoflutter/projects/rokcare/build/app/intermediates/bundle_manifest/release/processReleaseManifest/bundle-manifest/AndroidMani
fest.xml:40: AAPT: error: unexpected element found in .
[ ] * 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 56s
[ +355 ms] Running Gradle task 'bundleRelease'... (completed in 56.8s)
[ +4 ms] The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
[ +7 ms] Building plugin app_settings...
[ +7 ms] Running Gradle task 'assembleAarRelease'...
[ +1 ms] gradle.properties already sets android.enableR8
[ +2 ms] Using gradle from /Users/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/android/gradlew.
[ ] /Users/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/android/gradlew mode: 33261 rwxr-xr-x.
[ +2 ms] executing: [/Users/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/android/]
/Users/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/android/gradlew
-I=/Users/daveagyakwa/Desktop/devEnv/flutter/packages/flutter_tools/gradle/aar_init_script.gradle -Pflutter-root=/Users/daveagyakwa/Desktop/devEnv/flutter
-Poutput-dir=/Users/daveagyakwa/Desktop/repoflutter/projects/rokcare/build/app -Pis-plugin=true -PbuildNumber=1.0 -Pverbose=true -Pfont-subset=true
-Ptarget-platform=android-arm,android-arm64,android-x64 assembleAarRelease
[+1122 ms]
> Configure project :
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.

                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.2.2/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/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/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 927ms

[ +1 ms] Running Gradle task 'assembleAarRelease'... (completed in 1.1s)
[ +1 ms]
> Configure project :
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.

       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.2.2/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/daveagyakwa/Desktop/devEnv/flutter/.pub-cache/hosted/pub.dartlang.org/app_settings-4.0.4/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 927ms

[ +21 ms] "flutter appbundle" took 60,018ms.
[ +5 ms] The plugin app_settings could not be built due to the issue above.
[ +1 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 buildPluginsAsAar (package:flutter_tools/src/android/gradle.dart:848:7)
#2 _asyncErrorWrapperHelper.errorCallback (dart:async-patch/async_patch.dart:91:64)
#3 _rootRunBinary (dart:async/zone.dart:1214:47)
#4 _CustomZone.runBinary (dart:async/zone.dart:1107:19)
#5 _FutureListener.handleError (dart:async/future_impl.dart:157:20)
#6 Future._propagateToListeners.handleError (dart:async/future_impl.dart:708:47)
#7 Future._propagateToListeners (dart:async/future_impl.dart:729:24)
#8 Future._completeError (dart:async/future_impl.dart:537:5)
#9 _AsyncAwaitCompleter.completeError (dart:async-patch/async_patch.dart:47:15)
#10 buildGradleAar (package:flutter_tools/src/android/gradle.dart)
#11 _rootRunUnary (dart:async/zone.dart:1198:47)
#12 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#13 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#14 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#15 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#16 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#17 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#18 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#19 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart)
#20 _rootRunUnary (dart:async/zone.dart:1198:47)
#21 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#22 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#23 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#24 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#25 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#26 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#27 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#28 _run (package:flutter_tools/src/base/error_handling_io.dart)
#29 _rootRunUnary (dart:async/zone.dart:1198:47)
#30 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#31 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#32 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#33 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#34 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#35 Future.wait. (dart:async/future.dart:414:23)
#36 _rootRunUnary (dart:async/zone.dart:1198:47)
#37 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#38 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#39 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#40 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#41 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#42 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7)
#43 _rootRun (dart:async/zone.dart:1190:13)
#44 _CustomZone.run (dart:async/zone.dart:1093:19)
#45 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#46 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
#47 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#48 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#49 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#50 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

[ +256 ms] ensureAnalyticsSent: 254ms
[ +4 ms] Running shutdown hooks
[ ] Shutdown hooks complete
[ ] exiting with code 1

@eliasjtg
Copy link

I need deploy my app, any work around?

@spencerccf
Copy link
Owner

It's very strange that the local.properties file would be included for app_settings as it's not part of the final plugin since it's a locally specific file to user's development machine. Do you have your own local.properties file under your /Android folder with the following items defined:

sdk.dir=/Users/yourcomputerusername/Library/Android/sdk
flutter.sdk=/Users/yourcomputerusername/Library/Developer/flutter
flutter.versionName=0.0.1

@spencerccf
Copy link
Owner

I just tested the plugin in example app running flutter 1.22.3

@designdistrict
Copy link

Same problem here. And i have these variables in local.properties.

@spencerccf
Copy link
Owner

I've not been able to reproduce this error. Anyone else able to help?

@Pinkal7600
Copy link

I face the same issue while creating the Android build.

After spending sometime for solution, I got to know that I have used 28 for compileSdkVersion and targetSdkVersion in my 'Flutter project'->'android'->'app'->'build.gradle'.

Simply upgraded to 29 for both compileSdkVersion and targetSdkVersion. Boom!, I was able to create an Android build.

Hope this solution works for others!

@spencerccf
Copy link
Owner

Thanks @Pinkal7600

@5115191
Copy link

5115191 commented May 10, 2021

same issue,compileSdkVersion and targetSdkVersion is 29

@ozz-rjq
Copy link

ozz-rjq commented May 25, 2021

same issue

@EjazAmir
Copy link

Hi
Did you find any solution for this?

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

9 participants