How the build flutter gradle? Its failed - android

I added the firestore and firebase auth to my flutter project, but now it is not starting.
If I write gradlew build in the terminal I get a error code:
> Configure project :app
Adding a Configuration as a dependency is a confusing behavior which isn't recommended. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. If you're interested in inheriting the dependencies from the Configuration you are adding, you s
hould use Configuration#extendsFrom instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.artifacts.Configuration.html#org.gradle.api.artifacts.Configuration:extendsFrom(org.gradle.api.artifacts.Configuration[]) for more details.
at build_90hb1guh6a6ptpmu6otfn4x4q$_run_closure3.doCall(D:\eyyup\AndroidStudioProjects\todo\android\build.gradle:27)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the destinationDirectory property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.
gradle.api.tasks.bundling.AbstractArchiveTask:destinationDir for more details.
at FlutterPlugin$_addFlutterTasks_closure16$_closure35.doCall(D:\src\flutter\packages\flutter_tools\gradle\flutter.gradle:762)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
The AbstractArchiveTask.archiveName property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveFileName property instead. See https://docs.gradle.org/6.7/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.a
pi.tasks.bundling.AbstractArchiveTask:archiveName for more details.
at FlutterPlugin$_addFlutterTasks_closure16$_closure35.doCall(D:\src\flutter\packages\flutter_tools\gradle\flutter.gradle:763)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
> Configure project :firebase_auth
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestCompileClasspath'.
> Could not find com.google.firebase:firebase-analytics:.
Required by:
project :app
* 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 5s
What can I do the solve this problem?

Did you remember to update your build.gradle files? Or did you create this project with an older version of Flutter (in which case the dependencies might be too old for that version of Firebase Analytics).
Check that your android/build.gradle file contains the following:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
}
}
and your android/app/build.gradle file contains the following:
dependencies {
def multidex_version = "2.0.1"
implementation "androidx.multidex:multidex:$multidex_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics:17.2.2'
}
apply plugin: 'com.google.gms.google-services'
Further information is here https://github.com/FirebaseExtended/flutterfire/issues/2649#issuecomment-635855829

Related

Crop Image library Android

does some one has already attemted use this https://github.com/CanHub/Android-Image-Cropper
library ? could please to send your own github or explain me how to setup. I've setted up but always graddle failing . because I've attempted to setup this library
but in gradle syncning time always I'm getting build faild .
please without bulling or hating
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.CanHub:Android-Image-Cropper:3.3.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
- https://repo.maven.apache.org/maven2/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
- https://jcenter.bintray.com/com/github/CanHub/Android-Image-Cropper/3.3.4/Android-Image-Cropper-3.3.4.pom
Required by:
project :app
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
19 actionable tasks: 18 executed, 1 up-to-date
Because of updating ArctixFox Android Studio allproject {repositories } not exist anymore maven { url 'https://jitpack.io' } whe should I add this
From the error you are getting, it seems like Gradle is unable to resolve CanHub dependency. It could be most probably because you may not have included the jitpack repository in your project's build.gradle (not module's build.gradle).
To add jitpack to the repositories, add maven { url 'https://jitpack.io' } to your project level build.gradle
buildscript {
repositories {
....
maven { url 'https://jitpack.io' }
}
}
Because of updating ArctixFox Android Studio allproject {repositories } not exist anymore
allprojects is still available to use in project-level build.gradle, but now it's not get added by default to the new project, and you would get a GradleScriptException after adding it, as the build is configured to prefer settings.gradle over it.
setting.gradle now includes a dependencyResolutionManagement. If you want to add new repositories using allprojects you have to comment or remove dependencyResolutionManagement, or you can just add your repositories to the repositories block of dependencyResolutionManagement in settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}

I am unable to use TouchImageView dependency

I'm trying to use the dependency of TouchImageView for android. I'm unable to use the functions in the class and getting this error in Log
[1]: https://github.com/MikeOrtiz/TouchImageView
Task failed with an exception.
What went wrong:
Execution failed for task ':hideItPro:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':hideItPro:debugRuntimeClasspath'.
Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1.
Required by:
project :hideItPro
> Could not resolve com.github.MikeOrtiz:TouchImageView:1.1.1.
> Could not get resource 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'.
> Could not GET 'https://s3.amazonaws.com/moat-sdk-builds/com/github/MikeOrtiz/TouchImageView/1.1.1/TouchImageView-1.1.1.pom'. Received status code 403 from server: Forbidden
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 27s
303 actionable tasks: 270 executed, 33 up-to-date
In settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
//here the dependency
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
}
}
include ':app'
rootProject.name = "Apk"
this worked for me
Add maven repository in project build.gradle file,
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add dependencies in app build.gradle file,
dependencies {
...
implementation 'com.github.MikeOrtiz:TouchImageView:1.4.1' // last SupportLib version
// or
implementation 'com.github.MikeOrtiz:TouchImageView:$LAST_VERSION' // Android X
}

Build failed when adding Neumorphism dependency in Android

I am trying to add Neumorphism and DayNightSwitch dependency in Android but the build failed every time.
I tried many times but I didn’t figured out what's the problem is.
The gradle plugin is 7.2 and the Gradle version is 7.0.1
Neumorphism dependency
dependencies {
implementation 'com.github.fornewid:neumorphism:{latest_version}'
}
DayNightSwitch dependency
dependencies {
implementation 'com.github.Mahfa:DayNightSwitch:1.4'
}
8: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.fornewid:neumorphism:0.3.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
- https://repo.maven.apache.org/maven2/com/github/fornewid/neumorphism/0.3.0/neumorphism-0.3.0.pom
Required by:
project :app
* 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.
Please try to specify a version for the dependency
implementation 'com.github.fornewid:neumorphism:0.3.0'
Please add Neumorphism dependecy in your app level build.gradle as below,:
implementation 'com.github.fornewid:neumorphism:0.3.0'
And add these lines inside dependencyResolutionManagement to your Settings.gradle:
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
jcenter() // Warning: this repository is going to shut down soon
}

Missing com.android.tools.build.gradle4.1 in Android Studio

Here is my build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And here is gradle-wrapper:
#Fri Jan 12 02:39:29 EST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
The full error trace is here:
Error:FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'CryptoGallery'.
> Could not resolve all files for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:4.1.
Searched in the following locations:
file:/home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.pom
file:/home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/4.1/gradle-4.1.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1/gradle-4.1.jar
Required by:
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 0s
I took a look in the directory /home/xavi/android-studio/gradle/m2repository/com/android/tools/build/gradle/4.1/ and saw that I do have a gradle 4.1 build, but it doesn't contain a simple .jar like the others do. It's the full download from the official gradle website. It contains many executables, but none labeled gradle-4.1.jar like the others.
Edit: After changing classpath to the correct line, android studio prompts me to update my gralde to 4.4.1, and I get a traceback.
Don't confuse gradle with the androd plugin for gradle.
Change:
classpath 'com.android.tools.build:gradle:4.1'
with:
classpath 'com.android.tools.build:gradle:3.0.1'
More info here.

Execution failed for task ':app:transformClassesAndResourcesWithProguardForXXXRelease'

When I upgrade android studio version to 2.3,and gradle version to 3.3,and android gradle plugin version to 2.3.0,and buildToolsVersion version to 25.0.0,It has some problem when I use this command "gradlew assembleRelease" to package my application.
Shrinking...
Printing usage to [E:\workspace\android_source\src\app\build\outputs\mapping\XXX\release\usage.txt]...
Removing unused program classes and class elements...
Original number of program classes: 10650
Final number of program classes: 10247
Optimizing...
Warning: Exception while processing task java.io.IOException: java.lang.NullPointerException
:app:transformClassesAndResourcesWithProguardForXXXRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesAndResourcesWithProguardForXXXRelease'.
> Job failed, see logs for details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 34.554 secs
but when I downgrade android gradle plugin to version 2.2.3,and buildToolsVersion to 23.0.1,It works well.
I have resolved this problem,It is because the proguard version is too low,if we update the gradle plugin,the version is greater than 2.3.0,we must use the proguard version 5.3.2 or higher,this is how to use the high proguard version,here is two solutions:
1.Add these code in build script method of your build.gradle file:
buildscript {
...
configurations.all {
resolutionStrategy {
force 'net.sf.proguard:proguard-gradle:5.3.3'
}
}
}
then,repackage.
2.To download proguard.jar by this link
.then,create a folder in root path of your project,put the jar in this folder,add these code in your build.gradle file:
buildscript {
repositories {
flatDir{dirs 'proguard'}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath ':proguard:'
}
}
then,repackage.

Categories

Resources