Open arunkumard001 opened 2 years ago
Did you find any solution? I'm facing the same problem, tried to downgrade gradle version and it works but doesn't let me work with other features (so it's not a solution). Did anyone solved it?
s i found a solve i using a git rep just paste in your pubspec.yaml file at dependencis tflite: git: url: https://github.com/zhengbomo/flutter_tflite.git ref: master
Still having using gradle 4.2.0, doesn't allows you to work with 7.0.2 but thanks anyway, I'll let you know if I find a different solution
@rocaes did you find other solution ?
@himsa I made a workaround that is not exactly a solution but it solved my problem at least for the project i had at that time, so that I made a web page with tensorflow.js and i used a webview, which is not the best solution but, it worked out for me. I don't know if you can use it as a solution...
Hello, you can use my repo
tflite_maven: git: url: https://github.com/NavidHosseini/tflite.git ref: master
Its is work fine for now
Change the android/build.dradle
buildscript {
ext.kotlin_version = '1.6.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And change the app/build.gradle
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) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 32
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "your app name"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion 21
targetSdkVersion 32
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
aaptOptions {
noCompress 'tflite'
noCompress 'lite'
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
wheni run my flutter run i get this error
FAILURE: Build failed with an exception.
Where: Build file 'C:\Users\Arun\flutter.pub-cache\hosted\pub.dartlang.org\tflite-1.1.2\android\build.gradle' line: 24
What went wrong: A problem occurred evaluating project ':tflite'.
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