Error:This project does not use the Gradle build system, even though it was build in gradle system before - android-studio

My project was build initally with bradle build system in android studio after I switching branches in git I got the following error.
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
When i try exetuting gradle task I get error :
Error:Android Source Generator: [project-name] AndroidManifest.xml file not found , Even though I have the file in proper place.
I have been trying to fix this from several days. I have tried re-importing the project, clone the project again. Any help is gladly welcome.
Thanks,

Related

Problem with build Gradle 7.2 , still writtencolud not find Gradle 6.1.1

I just downloaded gradle6.1.1 to my android studio ,every time i build any project i get the following: Could not find com.android.tools.build:gradle:6.1.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
Required by:
project :capacitor-app
Add google Maven repository and sync project
Open File
is there a way anyone can help me… or may be tell me where to save gradle-6.1.1.pom on my device.
Thank you
build.gradle file must be like that
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
gradle-wrapper.properties file must be like that
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-all.zip

android studio error - Could not determine the dependencies of task ':app:installDebug'

While running the React Native Android app, then building the project the following error is shown:
Could not determine the dependencies of task ':app:installDebug'.
Go to android folder in your project and then type
gradlew clean for Windows and
./gradlew clean for Mac and Linux. I use this method every time I encounter the same problem, and also when changing the package.json (add / remove library)
Please remove build folder in /android/app and run build command again.
It worked for me.

No incremental compile snapshot data available gradle error

I am launching a Gradle task and it gives me an error like No incremental compile snapshot data available. I've searched online and I can't find a sufficient description for this. Do you know what exactly raises this error?
What gradle version are you using, found an old bug in v4.10: https://github.com/gradle/gradle/issues/6612
My project is using gradle 4.10 version. However, gradlew.bat clean build --refresh-dependencies solved this problem for me.
By Deleting the .gradle folder of Android Project.
Then do gradle sync and build apk.
It will solve this problem

Android Studio 1.2: Error:Android Source Generator: [app] AndroidManifest.xml file not found

I updated to AS 1.2 and I just tried importing/opening one my previous projects that worked on the previous version of AS. However, when I try building the project, I get an error saying
Error:Android Source Generator: [app] AndroidManifest.xml file not found
but this doesnt make sense since my manifest is src/main folder. How can I fix this and avoid this problem for all of my other projects?
This also bothered me recently, and I'm guessing that Gradle wasn't building it right.
In my circumstance, I just hit the Sync Project with Gradle Files button at left of AVD Manager button. If possible, you can goes with Gradle command lines as well.
then it popped out some errors said that I failed to find Build Tools revision 21.0.2(also this had been installed again and again, assuming I didn't set it right).
After installed some SDKs, clicked finish, studio will automatically rebuild your project.
There it works, can run the project now.

Android Studio include maven artifact in APK (gradle)

I have an Android project that requires the Jsoup library. I've tried everything I can think of to get the jar shaded into the APK.. I just can't get it working. Logcat tells me:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: org.jsoup.Jsoup
Does anyone know how to include/shade a maven artifact into an APK with Android Studio?
I have found the answer. The trick is to append ":sources". See an example here: http://www.alonsoruibal.com/my-gradle-tips-and-tricks/
I have seen the same type of error every time someone else adds a library with Gradle. Build is usually successful but app crashes when it tries to use the new library. Running task clean with Gradle helps.

Resources