Could not find gradle-3.5.0.jar - android

After adding the image_picker to my flutter project. The project started to fail building and gave me the following:
flutter_plugin_android_lifecycle:classpath'. > Could not find gradle-3.5.0.jar
after doing an extended research on how to solve the problem, I tried the following:
upgrading flutter
change the compileSdkVersion and targetSdkVersion to 29
flutter clean
enabling multiDexEnabled
flutter pub cache repair
none of the above mentioned methods solved the problem.

After a day of trying different things, I did the following since same problems used to happen to me while I used to work on Android native:
I just deleted the .gradle folder and it solved the problem.
I don't exactly know what is the reason, but if I have to guess I think it's related to network issues while making gradle build.

Related

A problem occurred configuring project ':#react-native-async-storage_async-storage'

I get this error when I try to run react-native run-android.
This is the full error message:
A problem occurred configuring project ':#react-native-async-storage_async-storage'.
com.android.builder.errors.EvalIssueException: defaultConfig contains custom BuildConfig fields, but the feature is disabled.
To enable the feature, add the following to your module-level build.gradle:
android.buildFeatures.buildConfig true
I've found these solutions to similar errors: this, this, this and this but, the problem still remains.
In other words,
I updated my java version to 15 (I tried also 19).
I tried different Gradle Versions (mainly of 8+).
I installed npm i jetifier.
I added android.buildFeatures.buildConfig true in android/app/build.gradle (ChatGPT suggestion).
There is also a suggestion to the issue I've opened here
I updated Android Studio
Additional notes:
The app is uploaded in Play Store and the last time I worked on it, was three months ago. So I guess I have to update something.
I used to have the community package #react-native-community/async-storage, which is deprecated, so I replaced it with this one: #react-native-async-storage/async-storage.

error -The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using

I am trying to build the android apk. I am facing the below error.
Tried with flutter clean, updated pub get, and I am using flutter 2.2.3
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin cloud_firestore...
Running Gradle task 'assembleAarRelease'...
Do these steps : 1. Try adding this line In your Project folder > android > app > build.gradle, add the following Line in
multiDexEnabled true
inside defaultConfig
2.Then upgrade gradle dependency in the android/build.gradle file: classpath 'com.android.tools.build:gradle:3.3.1' (previously on version 3.2.1)
3.Run flutter clean and rebuild your project
Based on your other feedback, the basic troubleshooting is
(1) flutter doctor and
(2) to try to build the apk for the sample app. See https://docs.flutter.dev/get-started/test-drive?tab=terminal
If the build works with the sample app, then you know your environment is good but something is up with your app.
(3) if you think your gradle might be corrupted, you might copy your lib/ and pubspec.yaml to a blank project to start.
You mentioned a cloud_firestore issue. There are several things that need to be setup to get cluod_firestore working, including the google-services.json that are easy to mess up.
You might also have version incompatabilities with firebase. There are some breaking changes in the last couple of years.
I always try to run the sample/example code first to see if my tooling is correct. So, try that with flutter fire: https://firebase.flutter.dev/docs/overview

debug build cannot access out.jar during build because it is being use by another process

now that I'm working from home I'm trying to work for my home desktop (windows) when I try and run a debug build. I get the error.
Execution failed for task ':app:packageDebug'.
> Exception modifying resource jar file: : D:\Dev\APPFOLDER\app\build\intermediates\merged_java_res\debug\out.jar: The process cannot access the file because it is being used by another process.
I don't understand what is going on I can run the build just fine on my laptop (Mac). I've even gone as far as to completely factory reset my computer.
I've not figured out how to fix this but the issue is with com.heapanalytics.android I've disabled heap for now.
This happened with me and solved it by adding this to your build.gradle if you are initialization it in the run time.
android {
defaultConfig {
// Add this section to enable Heap event capture.
ext {
heapEnabled = true
}
// ...
}
// ...
}
Hi #Donovan I've been facing the same issue when started updating my project from windows. Same project works fine and able to build apk in mac os.
Finally figured out the cause because of your answer. Thanks and check out below solution too.
Current System OS : Windows 10
My solution :
---Nb:Only disabling heap analytics will work. But I tried below steps with heap analytics and works for me.
Updated all dependencies with latest version (only updating lib doesn't resolve the issue: but its recommended).
Update 'com.heapanalytics.android' version (**very important) in project level build.gradle. In my case I updated to version '1.7.0'
Update google play services version in project level build.gradle
Add permisiion in manifest if not previously included. It was for
firebase analytics instance.

gradle is missing ? i cant see gradle in android studio

I'm new to android. I have just finished downloading android studio and I am now setting up setting up gradle.
I think gradle is missing or my computer hasn't seen it yet. I am not sure and do not know how to solve this.
in the left column select project and click on that dropdown and change that to android and then it will show the gradle files. you have selected project so it shows the complete files and libraries or the project.
Happy coding!
Try to clean, rebuild and invalidate and restart the project.
If it still does not solve your issue, go to gradle module and try using different versions of gradle and make your minSDK to 15 and compileSdkVersion and buildToolsVersion to same versions. Try re-syncing.
If it still does not solve your issue, you might have problem with SDK. Try updating it to latest version.
Below src you see Project you are viewing project files,click to see dropdown and change it to android.You will see updates gradle.

Android studio Error:Failed to complete Gradle execution.Cause: SunTlsRsaPremasterSecret KeyGenerator not available

recently i have updated my android studio to new version 2.1.and changed root project gradle build compile sdk version to 23 and build tool version to latest 23.0.3(previous it was sdk-19 and build tool-22.0.0)& in other modules like projects build.gradle,facebook,imageswipeZoom also changed them to latest.in gradle properties changed distibution url to https://services.gradle.org/distributions/gradle-2.10-all.zip. i am getting SunTlsRsaPremasterSecret KeyGenerator not available.error i dont know what should i do.if i change any thing in those places i have changed it is showing peer not authenticated error, i am new to android so please help me to fix this error, spent 3 days of time to find solutions but not found.thanks in advance.
no solutions worked(listed in the stack overflow) for me, but i found solution (# http://tools.android.com/knownissues#TOC-peer-not-authenticated-errors-from-Gradle-sync-or-SDK-Manager) i fixed this issue by installing new jdk.(by reinstalling jdk also u can do it)

Categories

Resources