Could not resolve org.tensorflow:tensorflow-lite:+ - flutter

I'm having trouble running my flutter app
I try several solutions but still has an error
seems that the problem is with the tflite
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.tensorflow:tensorflow-lite:+.
Required by:
project :app > project :flutter_tflite
> Failed to list versions for org.tensorflow:tensorflow-lite.
> Unable to load Maven meta-data from https://jcenter.bintray.com/org/tensorflow/tensorflow-lite/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/org/tensorflow/tensorflow-lite/maven-metadata.xml'.
> Read timed out
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
allprojects {
repositories {
google()
mavenCentral()
}

I already fixed the issue.
what I did is change the
build.gradle
of the tflite plugin from jcenter() because jcenter is already been shutdown details here into mavenCentral().
you can change it directly in
C:\Users\flutter.pub-cache\hosted\pub.dartlang.org
locate the folder of tflite plugin you're using
and I set a default version of tflite so I can work with it offline Or online
some did also address the issue here in stack overflow here

Related

A problem occurred configuring project ':uni_links'

I want to use uni_links package in my Flutter project but when I run it I get the following error.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':uni_links'.
> Could not resolve all files for configuration ':uni_links:classpath'.
> Could not resolve com.android.tools.build:gradle:3.5.3.
Required by:
project :uni_links
> Could not resolve com.android.tools.build:gradle:3.5.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'. Received status code 403 from server: Forbidden
> Failed to notify project evaluation listener.
2
> Could not get unknown property 'android' for project ':uni_links' of type org.gradle.api.Project.
Can anyone help me with this?
To fix this issue check do you have google() repo in your project's level build.gradle file.
buildscript {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
}
}
allprojects {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
}

Flutter Execution failed for task ':stack_appodeal_flutter:compileDebugKotlin'. >

I tried to integrate Appodeal into my Flutter Project using latest stack_appodeal_flutter 1.2.0 Package.
I followed their instruction still got this error. Appreciate any help.
this is my Android build gradle
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://artifactory.appodeal.com/appodeal" }
}
}
If you have added
dependencies {
...
implementation 'com.appodeal.ads:sdk:2.11.0.+'
...
}
this in your build.gradle (module: app), please remove that and run again. Their documentation in pub.dev is little misunderstanding.

Kotlin Gradle plugin

Hello for every one I have some problems in android sudio
[!] Your project requires a newer version of the Kotlin Gradle plugin.
Find the latest version on https://kotlinlang.org/docs/gradle.html#plugin-and-versions, then update D:\flutter-programing\kidsgame\android\build.gradle:
ext.kotlin_version = ''
Exception: Gradle task assembleDebug failed with exit code 1
How can I make it?
enter image description here
You can do this change as shown in below image
So this was requirement with the new flutter update. Heres what you need to change.
From:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
To:
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
}
You are simply needing to change the version number to the latest version available on Kotlin's website. Which as of t0day should be what i've put above. Just run flutter clean and flutter pub get after this and youre done.

Failed to transform moshi-1.13.0.jar (failed for task biometric_storage:kaptGenerateStubsDebugKotlin)

I pulled a team's project that is made in Flutter from Git and for some reason when building the app (pressing the green arrow in Android Studio and running main.dart) I get the following message:
What went wrong:
Execution failed for task ':biometric_storage:kaptGenerateStubsDebugKotlin'.
> Could not resolve all files for configuration ':biometric_storage:kapt'.
> Failed to transform moshi-1.13.0.jar (com.squareup.moshi:moshi:1.13.0) to match attributes {artifactType=processed-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for JetifyTransform: C:\Users\UserName\.gradle\caches\modules-2\files-2.1\com.squareup.moshi\moshi\1.13.0\da685586facab9eb5c4fb630ce248be14e7da21b\moshi-1.13.0.jar.
> Failed to transform 'C:\Users\UserName\.gradle\caches\modules-2\files-2.1\com.squareup.moshi\moshi\1.13.0\da685586facab9eb5c4fb630ce248be14e7da21b\moshi-1.13.0.jar' using Jetifier. Reason: Unsupported class file major version 60. (Run with --stacktrace for more details.)
My build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.google.gms:google-services:4.3.5'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.kotlin_version = '1.4.31'
My gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Other maybe relevant info
Fluter Android Studio plugin 63.2.1
Dart Android Studio plugin 203.8452
Dart 2.15.1
Flutter 2.8.1
Nobody on my team gets this message so I suspect It has to do with some local configuration difference or maybe I have a different version of some program. Also, I can't update Gradle because that causes some other problems.
EDIT: After clearing the cache all of my teammates, got this error.
NOTE: I am the one who asked this question. The following solutions are independent and you can try just one of them or you can combine them. Choose the one that looks simpler and if that works then there is no need for the other ones.
SOLUTION 1
Try ignoring that one .jar that is causing the problem. You can do this by editing file "gradle.properties". Add android.jetifier.blacklist or android.jetifier.ignorelist (LINK TO RELATED QUESTION) depending on the version of Android Gradle plugin version that you are using (to check which version you use, go to your build.gradle and check com.android.tools.build:gradle:X.Y.Z ). If you use anything before 7.0.0 use android.jetifier.blacklist and after use android.jetifier.ignorelist.
I use 3.6.0 so for me android.jetifier.blacklist works and android.jetifier.ignorelist does not.
SOLUTION 2
Try updating gradle and android gradle plugin to version 7. I did not try this and I can't because this isn't my personal project, but if you can go for it. Why I think upgrading will help? Well this github issue talks about that.
SOLUTION 3
The following solution doesn't make any sense (at least to me, if someone can explain why this fixes the problem please do), but for some strange reason it works.
I add a new library called bye-bye-jetifier because my idea was that I should turn off jetifier. Prior to turning it off I have to check if I have any dependence that uses outdated code (the code that is not AndroidX) hence I decided to install bye-byte-jetifier. After installing my build.gradle looked like this. After running with the following config the problem was gone.
buildscript {
repositories {
google()
jcenter()
mavenCentral() // <--------- I added this
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.dipien:bye-bye-jetifier:1.2.1' // <--------- I added this
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.kotlin_version = '1.4.31'
Note that I didn't even apply the plugin (like the offical guide on bye-bye-jetifier says), that makes this solution even more confusing.
file: "gradle.properties" (Project Properties)
adding line below
android.jetifier.blacklist = com.squareup.moshi
You can also exclude moshi library from all the project
Write this in build.gradle(app)
configurations.all { exclude group:"com.squareup.moshi" }
Use carefully only when you know you don't use this library!

Compilation Errors in React Native Version 0.59.8 - Analytics & Push Kit

Can Anyone tell me how to resolve these compilation errors. Facing these issues while integrating Analytics & Push Kit in React Native?
Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve org.codehaus.mojo:animal-sniffer-annotations:1.17.
Required by:
project :app
> Could not resolve org.codehaus.mojo:animal-sniffer-annotations:1.17.
> Could not get resource 'http://developer.huawei.com/repo/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar'.
> Could not HEAD 'http://developer.huawei.com/repo/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar'.
> Read timed out
Could not resolve org.codehaus.mojo:animal-sniffer-annotations:1.17.
Required by:
project :app > io.grpc:grpc-core:1.16.1
> Could not resolve org.codehaus.mojo:animal-sniffer-annotations:1.17.
> Could not get resource 'http://developer.huawei.com/repo/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar'.
> Could not HEAD 'http://developer.huawei.com/repo/org/codehaus/mojo/animal-sniffer-annotations/1.17/animal-sniffer-annotations-1.17.jar'.
> Read timed out
> Could not resolve com.parse.bolts:bolts-applinks:1.4.0.
> Could not get resource 'http://developer.huawei.com/repo/com/parse/bolts/bolts-applinks/1.4.0/bolts-applinks-1.4.0.jar'.
> Could not HEAD 'http://developer.huawei.com/repo/com/parse/bolts/bolts-applinks/1.4.0/bolts-applinks-1.4.0.jar'.
> Read timed out
There could be below reasons for this issue
Integration issue
Linking issue
For Integration issue, please make sure that all the integration steps been followed as provided in the guides below.
https://developer.huawei.com/consumer/en/doc/development/HMS-Plugin-Guides/integrate-rn-sdk-0000001050159021
For liking issue, i would recommend you please use npm link command and try which will help you to link with the node modules.
this seems more likely to be an android/gradle configuration issue than a react-native issue. I do not have your source code so I cannot be sure, but I suspect you are missing something in the root level build.gradle
If you are migrating your app to HMS, I'd suggest you to cross reference your original project and simply add the line
maven {url 'http://developer.huawei.com/repo/'}
to the buildscript/repositories and allprojects/repositories blocks.
Following is a sample build.gradle file that can successfully resolve the problematic modules in your description:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 19
compileSdkVersion = 28
targetSdkVersion = 28
}
repositories {
google()
jcenter()
maven {url 'http://developer.huawei.com/repo/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.huawei.agconnect:agcp:1.2.1.301'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
maven {url 'http://developer.huawei.com/repo/'}
}}