I have a Windows 8.1 system with latest Android-Studio.
Now, when I create a new project, if I set it's path to be on partition Local Disk F, I will receive errors.
If I set the path of the project to be on Local Disk C, no errors appear.
What is the solution to this?
The errors that appear, are like:
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Program Files (x86)\Android\android-studio\sdk\build-tools\19.1.0\dx.bat --dex --output F:\==Android\TestingGradle2\app\build\intermediates\pre-dexed\debug\support-v4-19.1.0-e311e493b238b75da4095bd5ee7b69d76d73dc42.jar C:\Program Files (x86)\Android\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\19.1.0\support-v4-19.1.0.jar
Error Code:
1
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
...
file not found...
So the real problem is with the location of the Project
What can I do to solve this?
I cannot have all my dummy projects in Local Disk C because it is a SSD drive and it is small.
I noticed that all my folders on my F drive are read only, and do not have writing access priviledges, so I did the following steps so far:
I went to Properties->Sharing->Advanced Sharing->Permissions for the F drive and set them to Full Access.
Then I went to Properties-> Security and made sure all users listed there have Full Access to the drive
After this, still no change. The error keeps appearing every time I try a new project or old one that is located on that F drive.
Please help.
Thank you
Related
I’ve got big nasty error message recently when trying to build app. This happened after Windows crash (Insider build, ha ha).
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.io.IOException: java.util.concurrent.ExecutionException: java.io.UncheckedIOException: java.io.IOException: The file or directory is corrupted and unreadable
Here is full Gradle console output: https://pastebin.com/ri58vYN7
What I already tried:
Delete /.gradle directory
Delete app/build directory
Invalidate caches / restart
Clean project, rebuild project
What can I do about it? Is the only way to start new project?
The crash should be a good sign for you to start learning and using a version control like git and start using Linux.
Usually, after Windows crash, one or more of your files in your project got corrupted. Sometimes the file becomes blank or contains cryptic text which the Gradle can't read and process. You need to check each file inside your project and fix it.
You must cherish the problems because it happens when you starting a new project. Start using version control or you will lost your precious time and project when Windows crash again.
Afaik, crash is a feature of Windows.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithProfilers-transformForDebug'.
> java.io.IOException: Could not delete path
Myapplication\app\build\intermediates\transforms\profilers-transform\debug\jars\1\10\226ac48e5c8c6b8707c7d76c6056e5800dee24de.jar'
I have use android studio 2.4.
please suggest solution regarding above issue,thanks in advance!
Try deleting the directory or the file manually.
I guess some of the files in the target build directory is open in another tool you use. Just a file handle open in the folder which has to be cleaned. The build task 'clean' wants to delete all the files in the build directory(normally 'target') and when it fails, the build fails.
I had the same error, tried deleting the directory It didn't work. So this is what I did. I just copied all my project files except the "Build folder and "Build Folder" in App to a new directory and I opened the project from the new directory and it worked perfectly.
I setup a TeamCity server and have it successfully building several C#.NET projects. Now I'm trying to get it to build a simple Android project but cannot get it to work. Checking the BuildLog it fails with the following error:
[17:00:11][Step 1/1] Using IntelliJ IDEA External Make #141.3028
[17:00:11][Step 1/1] Loading project (2s)
[17:00:13][Step 1/1] C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
[17:00:13]
[Step 1/1] java.io.FileNotFoundException: C:\TeamCity\buildAgent\system\.jps\c67b7fe19e4788da\-1866084326\gradle\configuration.xml (The system cannot find the path specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:337)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:125)
at org.jetbrains.jps.gradle.model.impl.JpsGradleExtensionServiceImpl.getGradleProjectConfiguration(JpsGradleExtensionServiceImpl.java:113)
at org.jetbrains.jps.gradle.model.impl.GradleResourcesTarget.computeRootDescriptors(GradleResourcesTarget.java:69)
...
The directory ..\-1866084326\ exists but it does not contain a gradle subdirectory.
I am not very familiar with the details of building gradle/android projects as I've only ever used AndroidStudio's UI to build. I have done a lot of searching but have found virtually no information about setting up an android project in TeamCity beyond what is in the TeamCity user docs that effectively says "use IntelliJ IDEA Build Runner".
I setup a build config with an IntelliJ IDEA Project build step. The project settings are parsed without error and I leave everything the way it was detected. The only parameters I have are Android_SDK = C:\Users\%env.USERNAME%\AppData\Local\Android\sdk, API_Level = 23, and system.path.macro.USER.HOME = %env.HOMEPATH%.
This is on a Windows 7 x64 Pro server.
I can build the project directly in TeamCity's workdir using AndroidStudio so I expect it is a build runner configuration issue, but I cannot find any search results for this specific error. Does anyone have any ideas?
My gradle build in android Studio is failing because it can't access the cache.properties file. I have tried invalidating all caches and retrying but that did not work. I also reinstalled all the SDK tools. Here is the error I'm getting
Error:java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
Blockquote
Any advice on what to do, here is the complete console output:
FAILURE: Build failed with an exception.
* What went wrong:
java.io.FileNotFoundException: C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file specified)
C:\Users\Siddharth\AndroidStudioProjects\IntentAssignment.gradle\2.4\taskArtifacts\cache.properties (The system cannot find the file 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: 0.747 secs
delete gradle folder, quit Android Studio and Start again fixed this problem for me
run cmd
write %temp%
then temp folder open delete all file in temp then rebuild your project
hope this will solve your problem
After Search i found this answer and worked for me
thanks to #Salam El-Banna and #Naveed Ahmad
You don't have to delete all .gradle folders and no need to reinstall Android Studio.
I have the latest version of Android Studio and I faced that problem, the only thing that worked for me is to:
1- Navigate to
C:\Users\user.gradle\caches\2.x\
2- Copy the folder scripts , scripts-remapped and paste it somewhere safe just in case anything went wrong you will place it back
3- Delete this folder scripts and scripts-remapped from the directory C:\Users\user.gradle\caches\2.x\
4- Sync Project with Gradle Files and you are done.
When you sync your project Android Studio will generate new cache files.
It worked for me I hope it will work for you.
reference:
Cache.properties (The system cannot find the file specified)
Delete your Gradle folder
Invalidate cache and Restart
Simply these steps fix your issue.
I just started working on cocos2d-x to build games. I have completed setup. I am getting below error when I run "HelloCpp" sample.
(skipping file '.gitignore' due to ANDROID_AAPT_IGNORE pattern '.*')
Unable to add 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp\proj.android\assets\fonts\Marker Felt.ttf': Zip add failed
ERROR: unable to process assets while packaging 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp\proj.android\bin\resources.ap_'
ERROR: packaging of 'C:\cocos2d-x-2.2.1\samples\Cpp\HelloCpp\proj.android\bin\resources.ap_' failed
Kindly help me to fix this issue.
Thanks.
This problem has multiple solutions and I tried each one of them, and the last one worked properly. I am giving you the exact steps I took to get it work for me.
1.Check if Cygwin has the neccessary packages, if not install them. The following packages are required -
autoconf, automake, binutils, gcc-core, gcc-g++, gcc4-core, gcc4-g++, gdb, pcre, pcre-devel, gawk, make
(I skipped gcc4-core and gcc4-g++)
2.Tried renaming Marker Felt.ttf to remove the space, however since it gets regenerated, I searched for the file in all of my C: drive and renamed it everywhere.
3.Then I ran Eclipse in Administrator mode.
4.I was getting the same error although only once this time. So I changed the permission of the Asset folder in the build_native.sh itself. Just add the following line at the end of your build_native.sh file.(Taken from here)
chmod 777 -R "$APP_ANDROID_ROOT"/assets
and voila, it worked. I am not sure which one of the step was not required so I put everything here. I am guessing that running eclipse in admin mode was not required, since I can work now in normal mode too. Just in case you get into same problem you can try running it in admin mode.