Open tomtitherington opened 2 years ago
Same problem, but i noticed that the problem is with something in the package dependencies, because if i use an old version of my code it works fine but when i do in terminal "flutter pub update" with the latest update already installed (0.4.1) then the problem comes out.
@RomjanHossain @salvatoremiccio @tomtitherington
This issue is coming from another package please try this solution and let me know
https://github.com/endigo/flutter_pdfview/issues/168#issuecomment-1017104214
@RomjanHossain @salvatoremiccio @tomtitherington
This issue is coming from another package please try this solution and let me know
I tried and doesn't work for me
I have same issue. You can reproduce this error by creating a new project using flutter 2.10
You can do this step to solve this problem
open build.gradle
on android/app
directory
change your compileSdkVersion
compileSdkVersion 31
open build.gradle
on android
directory
buildscript {
ext.kotlin_version = '1.5.31' // change this kotlin version
repositories {
google()
jcenter() // add this line
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0' // change this version to 4.2.0
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
// add below code
jcenter()
maven {
url "http://jcenter.bintray.com/"
}
}
}
open file android/gradle/wrapper/gradle-wrapper.properties
change distributionUrl to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
The 100% solution is; add to jCenter() to your android root build.gradle file
repositories {
google()
mavenCentral()
jcenter() // here
}
allprojects {
repositories {
google()
mavenCentral()
jcenter() // and here
}
}
Thanks a Lot, @memishood ! your solution worked!
I confirm, @memishood's solution works. Great job man ;-)
@memishood's solution olso works without other instructions of @Jigneshiosdeveloper's solution. For example i use 'com.android.tools.build:gradle:7.0.2' and not 4.2.0 and works without iusses.
Describe the bug Flutter build for Android fails with a Gradle task exception.
To Reproduce Steps to reproduce the behaviour:
flutter build
Expected behaviour Project builds.
Smartphone (please complete the following information):
Additional Information
flutter doctor -v