java.nio.file.InvalidPathException after Update - android

I have recently updated my Android Studio to v 2.2 Preview 5. and as I tried to run my one of my project I am getting 2 Errors.
java.nio.file.InvalidPathException after Update (As I preview the layout.)
Error:Execution failed for task ':app:mergeDebugResources'.> D:\Work\petrichors\projects\Eguide\app\src\main\res\layout-xlarge-xhdpi-land: Error: Invalid resource directory name.
However the project was running fine on previous version I had.
Log:
java.nio.file.InvalidPathException: Illegal char <:> at index 8: #android:drawable/ic_menu_slideshow
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.ide.common.res2.ResourceItem.parseFileName(ResourceItem.java:585)
at com.android.ide.common.res2.ResourceItem.parseXmlToResourceValue(ResourceItem.java:405)
at com.android.ide.common.res2.ResourceItem.getResourceValue(ResourceItem.java:240)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:393)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:349)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:166)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.configurations.ResourceResolverCache.getResourceResolver(ResourceResolverCache.java:163)
at com.android.tools.idea.configurations.Configuration.getResourceResolver(Configuration.java:1212)
at com.android.tools.idea.rendering.RenderTask.getResourceResolver(RenderTask.java:198)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:425)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$52(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

However the project was running fine on previous version I had.
That directory has been invalid for several years. Most likely, the tools and Android just ignored it, or did not honor all of its qualifiers, and now the build tools are validating the directory names.
Change layout-xlarge-xhdpi-land to layout-xlarge-land-xhdpi. Qualifier rules have to appear in the directory name (left to right) in the order that they appear in "Table 2" (top to bottom).
Or, better yet, remove -xhdpi outright. Having a density qualifier in anything other than a drawable or mipmap resource directory is a code smell. It should not be necessary and may not be doing what you think it should be doing anyway.

I had the same InvalidPathException problem this morning, also after updated to v2.2 preview 5. I solved it by removing leading/trailing spaces and line-break on the concerned XML declaration.
Check if there is a ':' which should not be here.
It seems Android Studio is a bit more sensitive to XML values.

Related

Android Studio build error on NTFS partition

I'm having problems building apps on Android Studio. Things work fine when the project is on my ext4 partition, but when I created a new one on my NTFS, I encountered this:
Argument for #NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null
java.lang.IllegalArgumentException: Argument for #NotNull parameter 'message' of com/android/tools/idea/gradle/project/sync/GradleSyncState.syncFailed must not be null
at com.android.tools.idea.gradle.project.sync.GradleSyncState.$$$reportNull$$$0(GradleSyncState.java)
at com.android.tools.idea.gradle.project.sync.GradleSyncState.syncFailed(GradleSyncState.java)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.doPopulateProject(IdeaSyncPopulateProjectTask.java:135)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.populate(IdeaSyncPopulateProjectTask.java:97)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask.access$000(IdeaSyncPopulateProjectTask.java:39)
at com.android.tools.idea.gradle.project.sync.idea.IdeaSyncPopulateProjectTask$1.run(IdeaSyncPopulateProjectTask.java:86)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:750)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:305)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
The error disappeared when I restarted Android Studio, but after that I still cannot run my app (the project structure in the sidebar is not displayed properly).
I'm using Android Studio 3.2 on Ubuntu 18.04.1.
I figured it out. (By mistake, to be honest...)
Let's say you have an NTFS partition mount at /mnt/ntfs, and your project is at /mnt/ntfs/projects/project.
Your home partition (ext4) is mounted at /home, your home directory is /home/user and you have a symbolic link at /home/user/projects that points to /mnt/ntfs/projects.
The reason I (and hopefully you too) have encountered this error is that when using Android Studio's "Open Project..." option, I provided the symbolic link (/home/user/projects/project). When trying to provide the real path (/mnt/ntfs/projects/project) the gradle sync succeeded.
So to fix this for now, simply provide the real path. However, this should probably be addressed by IntelliJ or the developers of Gradle.

Android studio error java.lang.IllegalArgumentException: Resource name cannot be empty

I am attempting to reopen an older Android Studio project in version 3.0.
It compiles and launches just fine, but if I try to edit a layout in the layout designer, it won't load and simply keeps saying that it is waiting for the build to finish (which it has).
When I look in the IDE errors, I see this error:
provider: org.jetbrains.android.augment.AndroidPsiAugmentProvider#2180343: Resource name cannot be empty.
As I look though the trace info, I see nothing that points back at my project.
Any suggestions?
Here is the full trace output:
provider: org.jetbrains.android.augment.AndroidPsiAugmentProvider#2180343: Resource name cannot be empty.
java.lang.IllegalArgumentException: Resource name cannot be empty.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.android.ide.common.res2.ResourceItem.<init>(ResourceItem.java:115)
at com.android.ide.common.res2.IdGeneratingResourceParser$IdResourceItem.<init>(IdGeneratingResourceParser.java:202)
at com.android.ide.common.res2.IdGeneratingResourceParser.<init>(IdGeneratingResourceParser.java:81)
at com.android.ide.common.res2.ResourceSet.createResourceFile(ResourceSet.java:456)
at com.android.ide.common.res2.ResourceSet.createFileAndItems(ResourceSet.java:111)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:257)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:52)
at com.android.ide.common.res2.DataSet.loadFile(DataSet.java:275)
at com.android.tools.idea.res.ResourceFolderRepository$InitialScanState.loadFile(ResourceFolderRepository.java:325)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFile(ResourceFolderRepository.java:524)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFolder(ResourceFolderRepository.java:477)
at com.android.tools.idea.res.ResourceFolderRepository.scanResFolder(ResourceFolderRepository.java:449)
at com.android.tools.idea.res.ResourceFolderRepository.scanRemainingFiles(ResourceFolderRepository.java:375)
at com.android.tools.idea.res.ResourceFolderRepository.<init>(ResourceFolderRepository.java:119)
at com.android.tools.idea.res.ResourceFolderRepository.create(ResourceFolderRepository.java:152)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:76)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:64)
at com.android.tools.idea.res.ModuleResourceRepository.create(ModuleResourceRepository.java:95)
at com.android.tools.idea.res.ResourceRepositories.lambda$getModuleResources$2(ResourceRepositories.java:98)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getModuleResources(ResourceRepositories.java:95)
at com.android.tools.idea.res.ModuleResourceRepository.findModuleResources(ModuleResourceRepository.java:71)
at com.android.tools.idea.res.ModuleResourceRepository.getOrCreateInstance(ModuleResourceRepository.java:59)
at com.android.tools.idea.res.ProjectResourceRepository.computeRepositories(ProjectResourceRepository.java:81)
at com.android.tools.idea.res.ProjectResourceRepository.create(ProjectResourceRepository.java:73)
at com.android.tools.idea.res.ResourceRepositories.lambda$getProjectResources$1(ResourceRepositories.java:83)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getProjectResources(ResourceRepositories.java:80)
at com.android.tools.idea.res.ProjectResourceRepository.findProjectResources(ProjectResourceRepository.java:63)
at com.android.tools.idea.res.ProjectResourceRepository.getOrCreateInstance(ProjectResourceRepository.java:51)
at com.android.tools.idea.res.AppResourceRepository.computeRepositories(AppResourceRepository.java:156)
at com.android.tools.idea.res.AppResourceRepository.create(AppResourceRepository.java:123)
at com.android.tools.idea.res.ResourceRepositories.lambda$getAppResources$0(ResourceRepositories.java:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getAppResources(ResourceRepositories.java:65)
at com.android.tools.idea.res.AppResourceRepository.findAppResources(AppResourceRepository.java:117)
at com.android.tools.idea.res.AppResourceRepository.getOrCreateInstance(AppResourceRepository.java:99)
at org.jetbrains.android.dom.converters.ResourceReferenceConverter.getResourceTypesInCurrentModule(ResourceReferenceConverter.java:262)
at org.jetbrains.android.augment.AndroidPsiAugmentProvider.getAugments(AndroidPsiAugmentProvider.java:67)
at com.intellij.psi.augment.PsiAugmentProvider.lambda$collectAugments$0(PsiAugmentProvider.java:93)
at com.intellij.psi.augment.PsiAugmentProvider.forEach(PsiAugmentProvider.java:137)
at com.intellij.psi.augment.PsiAugmentProvider.collectAugments(PsiAugmentProvider.java:92)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getAllInnerClasses(ClassInnerStuffCache.java:139)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$getInnerClasses$3(ClassInnerStuffCache.java:72)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getInnerClasses(ClassInnerStuffCache.java:71)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getInnerClassesMap(ClassInnerStuffCache.java:182)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$findInnerClassByName$6(ClassInnerStuffCache.java:102)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.findInnerClassByName(ClassInnerStuffCache.java:101)
at com.intellij.psi.impl.source.PsiClassImpl.findInnerClassByName(PsiClassImpl.java:396)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFieldsFromClass(AndroidResourceUtil.java:190)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:182)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:168)
at org.jetbrains.android.AndroidGotoRelatedProvider.collectRelatedJavaFiles(AndroidGotoRelatedProvider.java:182)
at org.jetbrains.android.AndroidGotoRelatedProvider.getLazyItemsForXmlFile(AndroidGotoRelatedProvider.java:112)
at org.jetbrains.android.AndroidLineMarkerProvider.getMarkerInfo(AndroidLineMarkerProvider.java:91)
at org.jetbrains.android.AndroidLineMarkerProvider.doGetLineMarkerInfo(AndroidLineMarkerProvider.java:52)
at org.jetbrains.android.AndroidLineMarkerProvider.collectSlowLineMarkers(AndroidLineMarkerProvider.java:37)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:209)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:111)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
java.lang.IllegalArgumentException: Resource name cannot be empty.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.android.ide.common.res2.ResourceItem.<init>(ResourceItem.java:115)
at com.android.ide.common.res2.IdGeneratingResourceParser$IdResourceItem.<init>(IdGeneratingResourceParser.java:202)
at com.android.ide.common.res2.IdGeneratingResourceParser.<init>(IdGeneratingResourceParser.java:81)
at com.android.ide.common.res2.ResourceSet.createResourceFile(ResourceSet.java:456)
at com.android.ide.common.res2.ResourceSet.createFileAndItems(ResourceSet.java:111)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:257)
at com.android.ide.common.res2.ResourceSet.handleNewFile(ResourceSet.java:52)
at com.android.ide.common.res2.DataSet.loadFile(DataSet.java:275)
at com.android.tools.idea.res.ResourceFolderRepository$InitialScanState.loadFile(ResourceFolderRepository.java:325)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFile(ResourceFolderRepository.java:524)
at com.android.tools.idea.res.ResourceFolderRepository.scanFileResourceFolder(ResourceFolderRepository.java:477)
at com.android.tools.idea.res.ResourceFolderRepository.scanResFolder(ResourceFolderRepository.java:449)
at com.android.tools.idea.res.ResourceFolderRepository.scanRemainingFiles(ResourceFolderRepository.java:375)
at com.android.tools.idea.res.ResourceFolderRepository.<init>(ResourceFolderRepository.java:119)
at com.android.tools.idea.res.ResourceFolderRepository.create(ResourceFolderRepository.java:152)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:76)
at com.android.tools.idea.res.ResourceFolderRegistry.get(ResourceFolderRegistry.java:64)
at com.android.tools.idea.res.ModuleResourceRepository.create(ModuleResourceRepository.java:95)
at com.android.tools.idea.res.ResourceRepositories.lambda$getModuleResources$2(ResourceRepositories.java:98)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getModuleResources(ResourceRepositories.java:95)
at com.android.tools.idea.res.ModuleResourceRepository.findModuleResources(ModuleResourceRepository.java:71)
at com.android.tools.idea.res.ModuleResourceRepository.getOrCreateInstance(ModuleResourceRepository.java:59)
at com.android.tools.idea.res.ProjectResourceRepository.computeRepositories(ProjectResourceRepository.java:81)
at com.android.tools.idea.res.ProjectResourceRepository.create(ProjectResourceRepository.java:73)
at com.android.tools.idea.res.ResourceRepositories.lambda$getProjectResources$1(ResourceRepositories.java:83)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getProjectResources(ResourceRepositories.java:80)
at com.android.tools.idea.res.ProjectResourceRepository.findProjectResources(ProjectResourceRepository.java:63)
at com.android.tools.idea.res.ProjectResourceRepository.getOrCreateInstance(ProjectResourceRepository.java:51)
at com.android.tools.idea.res.AppResourceRepository.computeRepositories(AppResourceRepository.java:156)
at com.android.tools.idea.res.AppResourceRepository.create(AppResourceRepository.java:123)
at com.android.tools.idea.res.ResourceRepositories.lambda$getAppResources$0(ResourceRepositories.java:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:942)
at com.android.tools.idea.res.ResourceRepositories.getAppResources(ResourceRepositories.java:65)
at com.android.tools.idea.res.AppResourceRepository.findAppResources(AppResourceRepository.java:117)
at com.android.tools.idea.res.AppResourceRepository.getOrCreateInstance(AppResourceRepository.java:99)
at org.jetbrains.android.resourceManagers.LocalResourceManager.getResourceNames(LocalResourceManager.java:261)
at org.jetbrains.android.resourceManagers.ResourceManager.getResourceNames(ResourceManager.java:349)
at org.jetbrains.android.augment.ResourceTypeClassBase.buildResourceFields(ResourceTypeClassBase.java:40)
at org.jetbrains.android.augment.ResourceTypeClass.buildLocalResourceFields(ResourceTypeClass.java:30)
at org.jetbrains.android.augment.AndroidPsiAugmentProvider.getAugments(AndroidPsiAugmentProvider.java:107)
at com.intellij.psi.augment.PsiAugmentProvider.lambda$collectAugments$0(PsiAugmentProvider.java:93)
at com.intellij.psi.augment.PsiAugmentProvider.forEach(PsiAugmentProvider.java:137)
at com.intellij.psi.augment.PsiAugmentProvider.collectAugments(PsiAugmentProvider.java:92)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getAllFields(ClassInnerStuffCache.java:125)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$getFields$1(ClassInnerStuffCache.java:60)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getFields(ClassInnerStuffCache.java:59)
at com.intellij.psi.impl.source.ClassInnerStuffCache.getFieldsMap(ClassInnerStuffCache.java:145)
at com.intellij.psi.impl.source.ClassInnerStuffCache.lambda$findFieldByName$4(ClassInnerStuffCache.java:82)
at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:141)
at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:49)
at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:222)
at com.intellij.psi.impl.PsiCachedValue.getValueWithLock(PsiCachedValue.java:60)
at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:38)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:137)
at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:127)
at com.intellij.psi.impl.source.ClassInnerStuffCache.findFieldByName(ClassInnerStuffCache.java:80)
at com.intellij.psi.impl.source.PsiClassImpl.findFieldByName(PsiClassImpl.java:362)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFieldsFromClass(AndroidResourceUtil.java:195)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:182)
at org.jetbrains.android.util.AndroidResourceUtil.findResourceFields(AndroidResourceUtil.java:168)
at org.jetbrains.android.AndroidGotoRelatedProvider.collectRelatedJavaFiles(AndroidGotoRelatedProvider.java:182)
at org.jetbrains.android.AndroidGotoRelatedProvider.getLazyItemsForXmlFile(AndroidGotoRelatedProvider.java:112)
at org.jetbrains.android.AndroidLineMarkerProvider.getMarkerInfo(AndroidLineMarkerProvider.java:91)
at org.jetbrains.android.AndroidLineMarkerProvider.doGetLineMarkerInfo(AndroidLineMarkerProvider.java:52)
at org.jetbrains.android.AndroidLineMarkerProvider.collectSlowLineMarkers(AndroidLineMarkerProvider.java:37)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.queryProviders(LineMarkersPass.java:209)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.lambda$doCollectInformation$3(LineMarkersPass.java:111)
at com.intellij.codeInsight.daemon.impl.Divider.divideInsideAndOutsideInOneRoot(Divider.java:96)
at com.intellij.codeInsight.daemon.impl.LineMarkersPass.doCollectInformation(LineMarkersPass.java:106)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:242)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Update:
I have not found a solution yet, but a coworker working on another project (from which I forked my project) has just had the same thing happen to him. This leads me to think this may be project specific. However, none of the error trace shows anything in our project. This obviously makes it hard to diagnose.
This error can occur when you update to Android Studio 3.0. It doesn't affect your ability to build a project, but the error does not allow you to visually see your xml layout files. You will also get the error when committing files to GIT, but you can still commit and push.
What I found in one of my projects is that a file was added to the "menu" folder automatically upon Android Studio upgrade, and the file had no name. It was named simply ".xml". All you need to do is delete the file and clean your project, allowing a new build of the project. That should take care of the issue.
Go to File>Invalidate Caches / Restart.
It might help!
Thank you!
I am able to fix it by Uninstall Android Studio 3.0 and installed Android Studio 3.1. Its working fine.
Maybe you can try it like this:
go to setting in AndroidStudio and change values like in this image.
Then click ok.

Android Studio drawable is missing

I'm using Android Studio 2.2 Preview 5.
When I try to render a layout, it displays following error:
Rendering Problems
java.nio.file.InvalidPathException: Illegal char <:> at index 8: #android:drawable/ic_menu_send
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.ide.common.res2.ResourceItem.parseFileName(ResourceItem.java:585)
at com.android.ide.common.res2.ResourceItem.parseXmlToResourceValue(ResourceItem.java:405)
at com.android.ide.common.res2.ResourceItem.getResourceValue(ResourceItem.java:240)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:393)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:349)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:166)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.configurations.ResourceResolverCache.getResourceResolver(ResourceResolverCache.java:163)
at com.android.tools.idea.configurations.Configuration.getResourceResolver(Configuration.java:1212)
at com.android.tools.idea.rendering.RenderTask.getResourceResolver(RenderTask.java:198)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:425)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$52(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
So I looked in the folder for android-19 and android-23:
sdk/platforms/android-**/data/res/drawable
But in neither of these is the file ic_menu_send.xml
My xml file contained a src="#android:drawable/ic_menu_send" once, but I removed it and chose another icon.
Then there was a ic_menu_send.xml (v21) in my res folder, so I deleted it because I didn't need it anymore.
If that was the reason, could someone please send me the ic_menu_send.xml file for the 2 versions or tell me how I can redownload all drawables?
I don't think what you deleted was an xml file, but an image file. So here you go:
http://i.stack.imgur.com/ZBWSc.png
Just save it as 'ic_menu_send.png' and put it back in that folder.

Android studio 2.2 preview 5 design editor/preview seem to be broken?

After updating from Android studio 2.2 preview 4 to 5, Design and Preview tabs stopped to show previews.
They don't show anything, only the error (described below) and a tip "Try to refresh the layout".
Refreshing and choosing different options in a top bar (API, device orientation) doesn't help.
Was trying File -> Invalidate Caches/Restart. Doesn't help either.
Any suggestions?
java.nio.file.InvalidPathException: Illegal char <:> at index 8: #android:drawable/ic_menu_send
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
at java.nio.file.Paths.get(Paths.java:84)
at com.android.ide.common.res2.ResourceItem.parseFileName(ResourceItem.java:585)
at com.android.ide.common.res2.ResourceItem.parseXmlToResourceValue(ResourceItem.java:405)
at com.android.ide.common.res2.ResourceItem.getResourceValue(ResourceItem.java:240)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:393)
at com.android.ide.common.res2.AbstractResourceRepository.getConfiguredResources(AbstractResourceRepository.java:349)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:166)
at com.android.tools.idea.configurations.ResourceResolverCache$1.compute(ResourceResolverCache.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:966)
at com.android.tools.idea.configurations.ResourceResolverCache.getResourceResolver(ResourceResolverCache.java:163)
at com.android.tools.idea.configurations.Configuration.getResourceResolver(Configuration.java:1212)
at com.android.tools.idea.rendering.RenderTask.getResourceResolver(RenderTask.java:198)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:425)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$52(RenderTask.java:659)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
UPD1: Seem to be an issue.
In your activity.xml file there must be a line as xmlns:app="". Delete it.
There is an error in xml file check that no
android: or xmlns:app=""
Fixed in Android studio 2.2 (Canary) Preview 6 (also see issue).

Eclipse crash after opening .xml file

i am starting with android development
i have created some sample application but
when i am opening .xml file resides in res/layout/main.xml
after that my eclipse crash and close.
i even try "open with android layout editor" which also crashes eclipse.
i am not getting why this problem occur.
my os is ubantu 9.04
and using eclipse Galileo
EDIT:
i am getting following error in my eclipse log file. what dose this means???
!ENTRY com.android.ide.eclipse.adt 4 0 2011-04-29 16:56:16.476
!MESSAGE loadAndParseRClass failed to find class com.saltriver.gui.R
!STACK 0
java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.lang.ClassLoader.defineClass(ClassLoader.java:465)
at com.android.ide.eclipse.adt.internal.resources.manager.ProjectClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.loadAndParseRClass(Unknown Source)
at com.android.ide.eclipse.adt.internal.resources.manager.CompiledResourcesMonitor.fileChanged(Unknown Source)
at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$DeltaVisitor.visit(Unknown Source)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:68)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:79)
at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:48)
at com.android.ide.eclipse.adt.internal.resources.manager.GlobalProjectMonitor$1.resourceChanged(Unknown Source)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:291)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:313)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1022)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1809)
at org.eclipse.core.internal.events.NotificationManager$NotifyJob.run(NotificationManager.java:40)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
"crash" is not very specific. Look into the file .metadata/.log in your workspace to see if Eclipse wrote an error message before it died.
If that doesn't help, start Eclipse from a console with -debug -console -consoleLog.
[EDIT] The error means that you're using Java X to run Eclipse but a plugin needs Java Y (where Y > X).
the usual case is that you run Eclipse with Java 5 and you have a plugin which needs Java 6. Unfortunately, the error message is useless: It doesn't tell you which class is the problem, from which JAR it came, which version it has and which versions are supported - The code has all the information but some smart guy decided that you don't need that. Pity.
So try to get the latest version of Java to run the IDE.
This is independent of the Java version which you use to build and run your projects!! It's just the VM which Eclipse uses to load its plugins. For VMs used in projects, see the Eclipse preferences.
Close 'Eclipse'
Go to your Eclipse folder open eclipse.ini file in any text editor.
after the line which says openFile add following two lines.
-vm
C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
(This folder path may vary according to your java installation directory).
save and close.
Open eclipse and tadaaaa!!! you can open xml files again. :)

Categories

Resources