I been developing my app in my Macbook and I put my project in Github.
I got a windows laptop and cloned my project from Github but when I build my app I'm getting these errors and my app won't build:
Error:FAILURE: Build failed with an exception.
* What went wrong:
Task 'generateDebugSources' not found in project ':app'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
How do I fix this?
Thanks
Please Check for file "YourProject/app/build.gradle" may be it is not there or it get corrupted( some times due to power failure the current running file become blank ). if you have older backup copy all syntax from there and past it on "YourProject/app/build.gradle".
I solved this problem in Android Studio by running File > Invalidate Caches...
Related
When I run the emulator while using vscode, I get an error like this. What can I do?
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by adding the line 'android.overridePathCheck=true' to gradle.properties file in the project directory.
* 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```
This error occurs because of the path of the project. Change your project path with a way which don't contain non-ASCII character.
For example ะก:\Android\PROJECT-FOLDER.
First run flutter doctor, to see if everything is okay
Then run flutter clean, to have a fresh start
If that doesn't work check the name of the path and try not to use special characters by that I mean, use English.
Or do a workaround and create a new project and copying the files to the new project, as I said before, stick to English, as a Spanish speaker I've run into the same issues before.
I run an Android Studio v2.1.3 and use ./gradlew build to detect errors in the Android project with the Findbags.
Recently an error started to come up:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':process:customFindbugs'.
> java.io.IOException: No files to analyze could be opened
There are enough disk space and RAM and beside that I don't see any particular reason for that error to occur. Please help to elaborate on this problem.
If you use 3.2, please take a note that
classes = files("$project.buildDir/intermediates/classes")
should be
classes = files("$project.buildDir/intermediates/javac")
I had the same problem after reorganizing my gradle files.
This is the actual command:
gradlew --stacktrace assemble findbugs
Accidentally, I did this:
gradlew --stacktrace findbugs
With the first command no error arises, with later it shows "java.io.IOException: No files to analyze could be opened".
To cut a long story short, maybe your files weren't compiled (yet).
I placed google-services.json file in my /app module directory. Still getting this error!
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Is there an updated solution to this problem? Please, anyone help me.
Same thing happens with me.
Remove the google-services.json file from your project .Set up for the API which you want in your project(Maps,FCM,etc).then place your google-services.json file in your root directory.Rebuild and clean.
Hope this will help you.
I have cloned from github both the respositories CastVideos-android and CastCompanionLibrary-android to my AndroidStudioProjects folder with the names 'CastVideos' and 'CastCompanionLibrary'. When I attempt to build CastVideos, in Android Studio I get
Gradle 'CastVideos' project refresh failed
Error:Bad pathname
When I run 'gradlew.bat build' in the CastVideos directory, I get the below:
C:\Users\Tim\AndroidStudioProjects\CastVideos>gradlew.bat build
Relying on packaging to define the extension of the main artifact has been depre
cated and is scheduled to be removed in Gradle 2.0
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'CastVideos'.
> Could not normalize path for file 'C:\Users\Tim\AndroidStudioProjects\CastVide
os\build\intermediates\exploded-aar\CastVideos...\CastCompanionLibrary\unspecifi
ed\debug'.
* 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: 7.701 secs
C:\Users\Tim\AndroidStudioProjects\CastVideos>
This is my first attempt at using Android Studio after developing with Eclipse so I am a bit lost. Any suggestions?
I think I know why. It is a Windows thing. It seems that Windows does not realize that '..' mean upper directory. that is why you have this path "C:\Users\Tim\AndroidStudioProjects\CastVide os\build\intermediates\exploded-aar\CastVideos...\CastCompanionLibrary\unspecifi ed\debug" I am running on the mac which seems to be working fine
I would suggest that you copy the whole CastCompanionLibrary into your CastVideo directory and then change ..:CastCompanionLibraries to :CastCompanionLibraries
Changing relative paths from ..: to ./..: in both build.gradle and settings.gradle worked for me on Windows.
I am having trouble migrating my eclipse project to Android Studio. I followed the instcutions on this page http://developer.android.com/sdk/installing/migrate.html
When I type gradle at the command line I get this error:
Where:
Settings file 'C:\Users\Joshua\Development\workspace\settings.gradle' line: 1
What went wrong:
A problem occurred evaluating settings 'workspace'.
A path must be specified!
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.1 secs
What path do you think it wants? And where does it want it?
So in my case I had a multi-project environment, what I had to do to get it working was to remove the absolute paths from the settings.gradle file in the root directory (dir containing all of the projects) and then in the build.gradle i had to remove the absolute directories for the compile statments and make sure that i used :{project_name} instead of ../{poject_name}
I realise that my situation was a bit different but if you download gradle and use the --debug switch you should be able to find which files have the problems and it's most likely a path problem.
You might be missing your lop-level build.gradle file. Here is a setup explained
If this is not your issue, please provide your settings.gradle file and top-level build.gradle file.