Closed jheimes-silveira closed 2 years ago
Hi @jheimes-silveira - Thanks for taking the time to open the issue and include the info you have provided. Can you share your /android/build.gradle
file?
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.1"
}
if (details.requested.group == 'androidx.core'
&& !details.requested.name.contains('androidx') ) {
details.useVersion "1.0.1"
}
}
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
a temporary solution I found was to redirect an environment variable: PUB_CACHE= point to the same root directory
this temporarily solved me
Thanks @jheimes-silveira. I am not sure if this is related to any in Amplify, but I will see if I can reproduce. I may follow up with more info as I attempt to reproduce this.
There have been similar issues (https://github.com/flutter/flutter/issues/88234) opened up in the flutter repo, but it looks like fixes were added in flutter 3.0.0 to resolve them.
Same issue with com.android.tools.build:gradle:7.x, but not gradle 4.x.
@jheimes-silveira > a temporary solution I found was to redirect an environment variable: PUB_CACHE= point to the same root directory
this temporarily solved i met the same error could you describe your solution in detail
Hey everyone - Apologies for the delay in an update. I just worked with a customer who reported this same issue on our Discord server. They were able to work around it by moving flutter and the project to the same drive. They only experienced this when Flutter was installed on their C drive and the project was on their F drive. It seems that this is only an issue on Windows when flutter is located on a different drive that the project that is being run. I am not sure if there is anything that we can do within Amplify to resolve this. It seems like this may be a limitation with Flutter and Windows.
If anyone is having this issue that is either not using Windows, or is using Windows but has confirmed that flutter is located on the same drive as the project that they are building, can you please share what OS you are seeing this on?
OS : Window sdk.dir=C:/Users/52304/AppData/Local/Android/Sdk flutter.sdk=D:\Flutter\scr\flutter
this is my OS and local.properties path. Is it possible to occure the error? project location: D:\GITup\BILJ\donewitharq
a temporary solution I found was to redirect an environment variable: PUB_CACHE= point to the same root directory
this temporarily solved me
thank you for providing the solution, but could you share the detail step that you solve this error
@Isaac-dot - What drive is the project you are trying to build located on?
@Isaac-dot - What drive is the project you are trying to build located on?
thank you for reply the project is located on D drive flutter is located on D drive as well
@Isaac-dot - Can you share the full exception you are seeing? Thanks
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring project ':amplify_auth_cognito_android'.
java.lang.IllegalArgumentException: this and base files have different roots: D:\GITup\BILJ\donewitharq\amplify_auth_cognito_android and C:\Users\52304\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\amplify_auth_cognito_android-0.6.5\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.
Get more help at https://help.gradle.org
BUILD FAILED in 5s Exception: Gradle task assembleDebug failed with exit code 1
@Isaac-dot - it looks like your pub cache is still located on your C drive. Can you try updating this to be the D drive since that is where you have flutter installed and where the app is located? See instructions under PUB_CACHE here: https://dart.dev/tools/pub/environment-variables
@Isaac-dot - it looks like your pub cache is still located on your C drive. Can you try updating this to be the D drive since that is where you have flutter installed and where the app is located? See instructions under PUB_CACHE here: https://dart.dev/tools/pub/environment-variables
thank you, i understand, but how can i change the pub cache location, i have been to the link that you provide, but i dont knnow how to set a PUB_CACHE environment variable. could you explain that thank you so much
It will vary depending on what version of windows you are on. Here is a pretty comprehensive guide on environment variables on Windows.
@Jordan-Nelson Sorry to bother you alot, i am new to flutter dart and AMS i am using windows 10. I create the PUB_CHACHE environment variables but how to redirect to it
I believe all you need to do is set that environment variable. Pub should use that to determine where to download dependencies. Try running the project again and see if you get the same error.
same error, the error shows that the environment variable still point tp the old one. i restart my laptop already. well do i need to delete the old environment variable path( the one in C drive )?
If you see that there is one set referencing the C drive, yes.
You can run 'echo %PUB_CACHE%' from command prompt to see if the var is set.
i delete the old one, it shows me other errors like system cannot find the command path. how should i change the import in the main.dart file
You will likely need to run 'flutter clean' and 'flutter pub get' to reinstall dependencies now that you have changed the location that they are downloaded.
You might also need to run 'flutter pub cache clean' or 'flutter pub cache repair'. You can read more about those here - https://dart.dev/tools/pub/cmd/pub-cache#reinstalling-all-packages-in-the-system-cache
Hey everyone - Apologies for the delay in an update. I just worked with a customer who reported this same issue on our Discord server. They were able to work around it by moving flutter and the project to the same drive. They only experienced this when Flutter was installed on their C drive and the project was on their F drive. It seems that this is only an issue on Windows when flutter is located on a different drive that the project that is being run. I am not sure if there is anything that we can do within Amplify to resolve this. It seems like this may be a limitation with Flutter and Windows.
If anyone is having this issue that is either not using Windows, or is using Windows but has confirmed that flutter is located on the same drive as the project that they are building, can you please share what OS you are seeing this on?
I will leave this issue open for a bit longer to see if anyone is having this issue that is unable to resolve it by updating the directory of their app, flutter, and/or pub. After that I will likely close this out since it doesn't appear to be specific to Amplify.
I faced the same issues. I found out that the problem is on the Flutter SDK. You may try to download new Flutter SDK and replace with the current one. It works for me.
I am going to close this issue since this appears to be a limitation with Windows/Flutter/Android, and not specific to Amplify. For anyone facing this issues, see this comment: https://github.com/aws-amplify/amplify-flutter/issues/1689#issuecomment-1221062758
I faced the same issue. I moved the app to the same flutter directory & build. It works for me.
Thank you @Jordan-Nelson . I faced the same issue. I set pub_cache variable and my issue is solved.
Description
i'm always getting this error when trying to compile
Categories
Steps to Reproduce
i'm always getting this error when trying to compile
Screenshots
Platforms
Android Device/Emulator API Level
API 32+
Environment
Dependencies
Device
Pixel 3a XL API 30 (Android-x86 emulator)
OS
Android 11
CLI Version
7.6.21
Additional Context
No response