Flutter buildproblem

0 votes

When I first downloaded flutter I ran into many problems trying to build the project. After trying maybe 10 different solutions, it started working after wiping the data of the emulator. Now we have a github project and im running in to the same problem again, tried wiping the data this time aswell but did not fix it. Anyone that has an idea of what the problem might be? Flutter doctor does not pinpoint any problems either, so now im completely lost. Im using a MacBook Pro M1, and running flutter on Android Studio.

Always get this error message:

`FAILURE: Build failed with an exception.

  • Where: Build file '/Users/artinmohseni/AndroidStudioProjects/hoothoot/android/build.gradle' line: 26

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

A problem occurred configuring project ':app'. Could not open proj generic class cache for build file '/Users/artinmohseni/AndroidStudioProjects/hoothoot/android/app/build.gradle' (/Users/artinmohseni/.gradle/caches/7.5/scripts/7i09q508vyjnbbjmnetph6qch). > BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 64

  • 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.

BUILD FAILED in 695ms Exception: Gradle task assembleDebug failed with exit code 1`

Ive used different versions of gradle builds, different java versions, wiped data of the emulators, but no success this time. Somehow when I clone the working project, that I somehow fixed, and then rename it to the project I want to create, create a new flutter project and overwrite it it somehow starts working. But when I clone the repo project it does not work.

Apr 12, 2023 in Flutter by sarit
• 1,830 points
3,396 views

1 answer to this question.

0 votes

It seems like there's an issue with the Android Gradle plugin or the version of Gradle being used. The error message suggests that there's an unsupported class file major version. You could try updating the Gradle version or Android Gradle plugin version. Also, make sure that you have the latest version of Flutter installed. If that doesn't work, try deleting the Gradle cache directory and running the build again. Running the build with the --stacktrace option may provide more information on the specific error that's occurring.

To know more about Flutter, join our Flutter Course today.

answered Apr 12, 2023 by Tanishqa
• 1,170 points

Related Questions In Flutter

0 votes
1 answer

Linking 3 Flutter Projects in One Flutter Project

Yes, it is possible to combine multiple ...READ MORE

answered Mar 20, 2023 in Flutter by vinayak
770 views
0 votes
1 answer

Flutter Projects & Android X Migration Issues

Migrating to AndroidX can be a frustrating ...READ MORE

answered Mar 20, 2023 in Flutter by Tej
572 views
0 votes
1 answer

How to change flutter project name and id?

Yes, it is possible to change the ...READ MORE

answered Mar 20, 2023 in Flutter by pooja
5,056 views
0 votes
1 answer
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,260 points
1,183 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,499 views
0 votes
1 answer

How to install Flutter in Windows system?

Hi@akhtar, You can follow the below-given steps to ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,806 views
0 votes
2 answers

How to create a circle icon button in Flutter?

To create something similar to a FloatingActionButton, ...READ MORE

answered Aug 23, 2023 in Flutter by anonymous
• 140 points
14,562 views
0 votes
1 answer

Flutter Like Button Animation Not Working After Adding Method

It seems like the issue might be ...READ MORE

answered Apr 12, 2023 in Flutter by Tanishqa
• 1,170 points
902 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP