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.
Related
I'm just trying to run the first app and this is what happens:
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':app:processDebugResources'.
File 'C:\Users\XXXX\Appdata\Local\Android\sdk\platforms\android-28\android.jar' specified for property 'androidJar' does not exist.
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 15s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
The file is on the android-29 folder! what should I do?
This error might occur because of android.jar is in another folder
Try opening
C:\Users\XXXX\Appdata\Local\Android\sdk\platforms
and then look
for a folder named android-29 or android-27 and you should be able to find android.jar in that folder just copy that file and paste it into to android-28
Image Please update your android sdk.
You don't have install api 28.
Please open your android sdk and install android sdk 28.
Not only android.jar is missing from my android-xx folder, then copy android.jar from other folder could solve this problem but I still have another problems when combine.
So I do a workaround
First, I delete this android-xx folder from Android\sdk\platforms
Then, I create a new empty project
Next, inside app\build.gradle of new project, I set both compileSdk and targetSdk to xx
Sync and run new project
Finally, android-xx will contains all the files
I dont know if delete the old android-xx before create new project is required or not. but I deleted it to make sure their is no other problem when replacing file
For some reason, android.jar is't automatically downloaded or built when installing specific Android SDK versions. This oversight means Flutter cannot find the android.jar, since it doesn't exist.
One solution, after installing the SDK version, is to manually download the android.jar for your desired SDK version from the following GitHub repository:
https://github.com/Sable/android-platforms
Make sure to put the android.jar file in the correct location, replacing XX with your version number:
Windows
C:\Users\XXXX\Appdata\Local\Android\sdk\platforms\android-XX\android.jar
OS X
Users/<username>/Library/Android/sdk/platforms/android-XX/android.jar
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 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...
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.