A problem occurred configuring project ':uni_links' - flutter

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?
}
}

Related

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

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

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.

Updating an old application caused this error => Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

Installed an app from git-hub to update it, using flutter 1.22.6 (because the app was built using this version) but facing this error when running the code.
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 17.3.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.6
> Failed to list versions for com.google.firebase:firebase-messaging.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/firebase/firebase-messaging/maven-metadata.xml'. Received status code 403 from server: Forbidden
Could not resolve com.google.android.gms:play-services-ads-identifier:[15.0.0, 16.0.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.6
> Failed to list versions for com.google.android.gms:play-services-ads-identifier.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'. Received status code 403 from server: Forbidd
en
Could not resolve com.google.android.gms:play-services-base:[10.2.1, 16.1.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.6
> Failed to list versions for com.google.android.gms:play-services-base.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-base/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-base/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-base/maven-metadata.xml'. Received status code 403 from server: Forbidden
because your project has old dependencies I suggest doing a Flutter clean.
but the error says that you don't have permission to download from the link. I think connect to VPN should solve this issue
For error related to 4XX, replace jcenter() with mavenCentral() in build.gradle file.
repositories {
google()
jcenter() //remove this
mavenCentral() //add this
}

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/'}
}}

Gradle Configuration of pluginRepository

I am trying to get a simple Gradle project (the one that is created by eclipse automatically) with static code analysis made by Sonar to run on our continuous integration. Our CI server is behind a proxy and i have to access the Gradle plugin repository over an internal Nexus server.
As described in the userguide i have added the following to my settings.gradle
pluginRepositories {
maven {
url 'http://link.to.my.nexus'
}
gradlePluginPortal()
}
rootProject.name = 'GradleTestProject'
my build.gradle looks like this:
plugins {
id "org.sonarqube" version "2.0.1"
}
apply plugin: 'java'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.21'
testCompile 'junit:junit:4.12'
}
When i run this on Jenkins, i get the following error message:
FAILURE: Build failed with an exception.
* Where:
Settings file '/opt/hudson/jobs/GradleTestProject/workspace/settings.gradle' line: 1
* What went wrong:
A problem occurred evaluating settings 'workspace'.
> Could not find method pluginRepositories() for arguments [settings_20tc2o9xuj82hi1fvpe4wvcvt$_run_closure1#52b56c40] on settings 'workspace'.
I have looked at other examples in the web. They all do it the same way as i described.
BTW: I am using Gradle 2.12
I'm in version 4.0.1.
I had the same error, found your question without answer and finally I found and tried this in settings.gradle and now it works.
pluginManagement {
repositories {
gradlePluginPortal()
}
}