-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Have a problem on Cannot resolve symbol for properties and Gradle exception #29608
Comments
Same for me here. Have anyone managed to resolve it? |
what is the solution please ? |
did u know the solution? |
If I recall correctly, I had a problem after switching to the new MacBook. So I've fixed it creating all the keystore things one more time. I mean signing configs, kjs, etc. |
plz what's the solution , i tried many ways nothing work :( , plz help , if u have fixed ur own |
Facing the same. Solution please :/ |
facing same problem, anyone has solution please? |
I have same problem. I get this error because I edit android module without open it first using AS in another tab (Tools -> Flutter -> Open Android module..). Then I have a solution, just restart and kill the chache in your Android Studio (File -> Invalidate Chache / Restart). It fixed for me, I hope you too |
Ok. Found the solution. Gradle shows the error because Flutter is not implemented with Gradle. That Means Gradle isn't build for Flutter, but for Java/Kotlin only. If you use VS Code, you will see no error is there. So, just build and don't mind gradle, other than adding stuffs as mentioned by Flutter team. |
(The following API 28 can be replaced with 29 as well since it is the latest as of now. 28 is recommended) Change your target SDK and compile SDK version to 28 Install API 28 from File -> Settings -> Appearance and Behaviour -> System Settings -> Android SDK -> SDK tools -> Select "Show package details from bottom right. Select all 28 versions, Apply. Go to File -> Project Structure -> SDK's under Platform Settings -> Define Android API 28 as build target and enter the path for the SDK "C:\Users%USERNAME%\AppData\Local\Android\Sdk", Apply Now, Go to modules under project settings in the same project structure, select Android API 28 from the dropdown. Restart the App. Hope this helps |
Still not resolved!! |
Same issue AS 3.5.1 ... Gradle plugin 3.5.1. |
same problem :( |
Same problem here. Does anyone has a solution or a workaround? |
Here also the default build.gradle file created by flutter when generating a project gives that annoying error. Environment: Android Studio 3.5.1 on Linux There shouldn't be any warnings or errors out of the box, that's confusing to beginners. |
Facing the same problem. When using firebase, I am not able to sync after making changes in the gradle file so not able to proceed.. |
Agree! I've solved all the problems in the project structure, but it doesn't work. |
same problem here |
Flutter needs to update their documentation. The key for me was changing GradleException() to FileNotFoundException(). Thank you @jasondphan |
Guys need help i'm coding new app with flutter but i'll try to implement from this guide https://fireship.io/lessons/flutter-realtime-geolocation-firebase/ `def localProperties = new Properties() def flutterRoot = localProperties.getProperty('flutter.sdk') def flutterVersionCode = localProperties.getProperty('flutter.versionCode') def flutterVersionName = localProperties.getProperty('flutter.versionName') apply plugin: 'com.android.application' android {
} flutter { dependencies { Properties() say can't resolve and GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") can't resolve when i compile gradle Finished with error: Gradle task assembleDebug failed with exit code 1 |
Closing this issue for now since the original question seems to have been answered, and the issue is now degrading into a variety Gradle-related troubleshooting issues. If you are still experiencing the original issue, you're welcome to reopen it. Please tell us exactly how to reproduce the problem you're running into. Attach a small sample that demonstrates the issue, or include the specific tool commands that reproduce the problem along with the results of running For more general troubleshooting, good places to ask questions or work through problems where you're more likely to get a fast response include: Thanks for using Flutter! |
The key for me was changing GradleException() to FileNotFoundException(). Thank you @jasondphan |
Changing the default |
I had the same problem ... but Solved it: i simply open the gradle file by righ clicking on it chose the option flutter and open for editing in andriod studio.. once open i clicked around a few times without changing anythin and boom all errors wer gone... Hope this work for you too ... good luck and happy coding :) |
Same Issue, I mean it shows no error and when I open to sync with firebase it throws i this error |
|
@zyllus17 Thanks for putting your solution out here! It worked for me as well. |
Your response is apt and resourceful. Thank you |
@zyllus17 Thanks for clear resolution steps it addressed it cleanly. |
change GradleException to FileNotFoundException |
Acceptable, simpler SOLUTION that worked for me........ Haven't checked all the comments and am not sure if anyone has provided this solution, but if u SIMPLY checked your SDK manager you'll probably find that your API 29 states is showing that it needs to be updated.. so just click on it and you'll find an updating icon on the left, once its there press "Apply" button |
For me just deleting new before Properties and GradleException it have solved it.
here is first lines in build.gradle 'contains changes'
|
… be found through following the advice in the following webpage: flutter/flutter#29608 (comment) Also updated some of the dependencies to the most recent versions
this video helps |
This worked for me, thanks 👍 |
We're not actively monitoring closed issues. If there are still unresolved issues, please open a new GitHub issue (https://github.com/flutter/flutter/issues/new/choose) and describe the the reproduction steps and the expected outcome. Reading through this thread, I'm not entirely sure what the original question is. Based on the responses, I'm guessing it's perhaps related to co-editing Android code in the /android/ directory while having a Flutter project root open in Android Studio with the Flutter IDE plugin? But I might be wrong. Please describe the needed workflow in a new issue. |
Deleting the new resolved the issue for me |
thx bro it works |
It might be more of a workaround than a solution, but I was looking for a way to ignore the error. I found that you can right click |
This fixes a warning given off by android studio. See: flutter/flutter#29608
Hi there guys the fix is easy just go to app/build.gradle and in line 11 just remove the new throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") if u look at my one I just send removed the "new" between the throw and gradleException and save and restart android studio an dthat will fix the problem |
U don't need to replace it with 'FileNotFoundException' just take out the word new and restart the software android studio that's all and it's that easy Hope u come right |
@CorneluisTech789 is right. weird... same thing with Properties, just remove the new keyword. why is this? |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.")
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.")
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
The text was updated successfully, but these errors were encountered: