error:
FAILURE: Build failed with an exception.
- What went wrong: A problem occurred configuring project ':livekit_client'.
Could not load compiled classes for build file 'C:\src\flutter.pub-cache\hosted\pub.dartlang.org\livekit_client-0.5.9\android\build.gradle' from cache. Failed to notify project evaluation listener. Could not get unknown property 'android' for project ':livekit_client' of type org.gradle.api.Project. Could not find method implementation() for arguments [project ':flutter_webrtc'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Could not find method implementation() for arguments [project ':device_info_plus'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Could not get unknown property 'android' for project ':livekit_client' of type org.gradle.api.Project.
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 6s Exception: Gradle task assembleDebug failed with exit code 1
**Flutter version**
PS D:\AndroidStudioProjects\git_repo\talky> flutter --version
Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2
PS D:\AndroidStudioProjects\git_repo\talky>
**AndroidMainfest.xml**
required permissions
<application
.....
.....
<service
android:name="de.julianassmann.flutter_background.IsolateHolderService"
android:enabled="true"
android:exported="false"
android:foregroundServiceType="mediaProjection" />
</application>
**Kotlin version - 1.6.10
Project level Build gradle
Dependency
**
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
flutter clean,pub get,invalidcash restart not work
CodePudding user response:
How I solved my problem by following the below method:
remove the problem making package from /.pub-cache/hosted/pub.dartlang.org
Run flutter pub get change this:
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.2-all.zip to this:
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip and then in project-folder/buil.gradle
change this:
classpath 'com.android.tools.build:gradle:3.5.0' to this:
classpath 'com.android.tools.build:gradle:4.1.1' and then run this command
flutter clean build or run your project, good luck.