I am getting the following errors compiling on Android, either from the command line or via Android Studio:
* Exception is:
org.gradle.api.UncheckedIOException: Failed to capture snapshot of input files for task 'bundleReleaseJsAndAssets' during up-to-date check
Caused by: java.io.FileNotFoundException: /Users/mikem/react/myapp/metro-bundler-symbolicate117923-49160-k3nnyf.htls935wmi.sock (Operation not supported on socket)
I have cleared out node_module and reset the caches, manually generated the bundle but this error continues.
Any help would be appreciated.
In case anybody else runs into this - the link metro-bundler-symbolicate117923-49160-k3nnyf.htls935wmi.sock did exist in that directory but had a root owner (perhaps could have been caused when I was trying to fix other issues). Deleting the link fixed the problem.
Related
I have an issue when building project after created a new project in different volumes in Mac Os.
This what error said :
Could not create service of type DefaultGeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().
> Timeout waiting to lock Java compile cache (/Volumes/SDMICRO/ANDROID/AwPlayerTes/.gradle/7.0.2/javaCompile). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 2394
Owner Operation: unknown
Our operation:
Lock file: /Volumes/SDMICRO/ANDROID/AwPlayerTes/.gradle/7.0.2/javaCompile/javaCompile.lock
Actually this is not my true directory in development project. But i have no choices because of run out of space. But this project are failure build. I have tried some solution like this. But none of them are works, FYI i use Mac and Android Studio Archtic Fox.
Please someone help me
please try to delete the Lock file, and then rebuild the project.
I encoutered the same problem and already solved it.
I am trying to work with Jenkins however I cannot build the apk with it as I am having issue with AAPT2 and Gradle.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-hdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-xhdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Android resource compilation failed
ERROR:C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-3\b478eb984dbbd1317dab9bfd9689b3aa\transformed\appcompat-1.3.0\res\drawable-mdpi-v4\abc_list_divider_mtrl_alpha.9.png: AAPT: error: file not found.
I already read tons of SO question that may share same issue to my case saying that it has something to do with the file path being too long but I still cannot find any solution.
UPDATE
I tried to change Android Studio Gradle home similar to what Jenkins is using and received similar error which indicates that it may really have something to do with long file path.
I think the final question will be how to change Jenkins Gradle Home?
You need to replace \ with \\ if you are giving path with jenkins in Windows.
May be if file path is too huge or that is the root cause you can try mounting the directory to a short path
EDIT : Based on your modified question :
Open Jenkins dashboard. Navigate to Manage Jenkins-> Configure System. Under the Global properties section add another environment variable named GRADLE_USER_HOME as shown below.
I ran into this exact issue, but unfortunately changing the GRADLE_USER_HOME environment variable did not help, as aapt2 appeared to ignore the change and still used Windows/system32/... for the cache location.
The problem was how I was running Jenkins as a service. In the service.msc settings, it was set to Log On as a Local System account, which set the USER_HOME variables to C:\Windows\System32. Because of this, the reason the error said that the file did not exist was because Jenkins/gradle did not have access to the System32 folder.
My fix was to change the log on method to 'This account', then enter a user account so Jenkins wasn't logged on as system anymore.
I am working on an android project. And I am facing a problem that while running app in android I am getting error i.e.
"Error:Failed to capture snapshot of output files for task 'transformClassesWithDexForDebug' property 'streamOutputFolder' during up-to-date check.
Failed to create MD5 hash for file 'app\build\intermediates\transforms\dex\debug\folders\1000\5\slice_0\classes.dex'."
And if I disable my antivirus I am able to run my app successfully and no error will occur. I am not able to understand what is happening.
its a privilege issue, give your folder rights to everyone and full-control
I experience problems when trying to build my Android project which depends on New Relic. See grade command and stack trace below.
Command:
./gradlew clean assembleProdDebug assembleProdDebugTest
See terminal output below:
...
:my-project:my-project:packageReleaseJniLibs[newrelic] Error encountered while loading the New Relic agent
java.io.IOException: File exists
at sun.tools.attach.BsdVirtualMachine.createAttachFile(Native Method)
at sun.tools.attach.BsdVirtualMachine.<init>(BsdVirtualMachine.java:74)
at sun.tools.attach.BsdAttachProvider.attachVirtualMachine(BsdAttachProvider.java:63)
at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
at com.sun.tools.attach.VirtualMachine$attach.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.newrelic.agent.android.NewRelicTask.injectAgent(NewRelicTask.groovy:45)
at com.newrelic.agent.android.NewRelicTask$injectAgent$0.callCurrent(Unknown Source)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':my-project:newRelicInstrumentTask'.
> java.io.IOException: File exists
It complains about "File exists" but it doesn't say anything about what file or where or how to solve it.
Top level build.gradle file has the following dependency:
classpath "com.newrelic.agent.android:agent-gradle-plugin:4.+"
and each of the two apps has the following:
compile 'com.newrelic.agent.android:android-agent:4.273.4'
New Relic and the build process worked perfectly fine until I merged two apps into the same Android studio project. I did this because the two apps share a lot of code with each other.
Anyone experienced the same problem? Any ideas on how to solve it? Just ask if you need more information.
When I try to run an android code in Processing 2.2.1 Android mode I get the following message:
Error from inside the Android tools, check the console.
And then:
java.io.FileNotFoundException: C:\Users\USER\Documents\Processing\modes\AndroidMode\icons\icon-96.png (The system cannot locate the resource specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at processing.app.Base.copyFile(Base.java:2698)
at processing.mode.android.AndroidBuild.writeRes(AndroidBuild.java:807)
at processing.mode.android.AndroidBuild.createProject(AndroidBuild.java:169)
at processing.mode.android.AndroidBuild.build(AndroidBuild.java:91)
at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:227)
at processing.mode.android.AndroidEditor$16.run(AndroidEditor.java:513)
BUILD FAILED
C:\Users\USER\AppData\Local\Temp\android9132488509980035650sketch\build.xml:9: The entity name must immediately follow the '&' in the entity reference.
Total time: 0 seconds
What can I do to solve it? I am a total beginner so please try to be as specific and clear as possible.
Thanks!
Program wants this file "C:\Users\USER\Documents\Processing\modes\AndroidMode\icons\icon-96.png" and cannot find it.