英文:
Android (kotlin) testing: 'posix:permissions' not supported as initial attribute
问题
尝试在WinOs上运行Android应用程序的测试时出现以下错误。是否可能如果不使用Mac/Linux就无法运行某些Android测试?我读到在WinOs上不支持posix。
我不直接使用posix。测试库在使用它。
不支持'posix:permissions'作为初始属性
java.lang.UnsupportedOperationException: 不支持'posix:permissions'作为初始属性 at
java.base/sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(WindowsSecurityDescriptor.java:358)
at
java.base/sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:509)
at java.base/java.nio.file.Files.createDirectory(Files.java:700) at
java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:134)
at
java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:171)
at java.base/java.nio.file.Files.createTempDirectory(Files.java:976)
at
com.google.common.io.TempFileCreator$JavaNioCreator.createTempDir(TempFileCreator.java:102)
at com.google.common.io.Files.createTempDir(Files.java:439) at
org.robolectric.internal.dependency.MavenArtifactFetcher.fetchArtifact(MavenArtifactFetcher.java:70)
at
org.robolectric.internal.dependency.MavenDependencyResolver.lambda$getLocalArtifactUrls$0(MavenDependencyResolver.java:93)
at
org.robolectric.internal.dependency.MavenDependencyResolver.whileLocked(MavenDependencyResolver.java:113)
at
org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrls(MavenDependencyResolver.java:88)
at
org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrls(MavenDependencyResolver.java:78)
at
org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrl(MavenDependencyResolver.java:129)
at
org.robolectric.plugins.LegacyDependencyResolver.getLocalArtifactUrl(LegacyDependencyResolver.java:89)
at
org.robolectric.plugins.DefaultSdkProvider$DefaultSdk.getJarPath(DefaultSdkProvider.java:148)
at
org.robolectric.internal.AndroidSandbox$SdkSandboxClassLoader.<init>(AndroidSandbox.java:128)
at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method) at
java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at
java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.robolectric.util.inject.Injector.inject(Injector.java:250) at
org.robolectric.util.inject.Injector.lambda$memoized$1(Injector.java:232)
at
org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
at
org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
at
org.robolectric.util.inject.Injector.resolveDependencies(Injector.java:296)
at org.robolectric.util.inject.Injector.inject(Injector.java:248) at
org.robolectric.util.inject.Injector.lambda$memoized$1(Injector.java:232)
at
org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
at
org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
at
org.robolectric.util.inject.Injector.getInstance(Injector.java:208)
at org.robolectric.util.inject.Injector.access$700(Injector.java:96)
at
org.robolectric.util.inject.Injector$ScopeBuilderProvider.create(Injector.java:564)
at
org.robolectric.util.inject.Injector$ScopeBuilderProvider.lambda$get$0(Injector.java:547)
at jdk.proxy3/jdk.proxy3.$Proxy24.build(Unknown Source) at
org.robolectric.internal.SandboxManager.getAndroidSandbox(SandboxManager.java:62)
at
org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:299)
at
org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:66)
at
org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:244)
at
org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at
org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at
org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:101)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at
androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:108)
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
at
org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
at
org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method) at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568) at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at
org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at
org.gradle
英文:
Trying to run test for android app (on WinOs), getting the error bellow. Is it possible that I can't run some android tests if I don't use Mac/Linux? I read that possix is not available on WinOs.
I am not using possix directly. Testing library is using it.
> 'posix:permissions' not supported as initial attribute
> java.lang.UnsupportedOperationException: 'posix:permissions' not
> supported as initial attribute at
> java.base/sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(WindowsSecurityDescriptor.java:358)
> at
> java.base/sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:509)
> at java.base/java.nio.file.Files.createDirectory(Files.java:700) at
> java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:134)
> at
> java.base/java.nio.file.TempFileHelper.createTempDirectory(TempFileHelper.java:171)
> at java.base/java.nio.file.Files.createTempDirectory(Files.java:976)
> at
> com.google.common.io.TempFileCreator$JavaNioCreator.createTempDir(TempFileCreator.java:102)
> at com.google.common.io.Files.createTempDir(Files.java:439) at
> org.robolectric.internal.dependency.MavenArtifactFetcher.fetchArtifact(MavenArtifactFetcher.java:70)
> at
> org.robolectric.internal.dependency.MavenDependencyResolver.lambda$getLocalArtifactUrls$0(MavenDependencyResolver.java:93)
> at
> org.robolectric.internal.dependency.MavenDependencyResolver.whileLocked(MavenDependencyResolver.java:113)
> at
> org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrls(MavenDependencyResolver.java:88)
> at
> org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrls(MavenDependencyResolver.java:78)
> at
> org.robolectric.internal.dependency.MavenDependencyResolver.getLocalArtifactUrl(MavenDependencyResolver.java:129)
> at
> org.robolectric.plugins.LegacyDependencyResolver.getLocalArtifactUrl(LegacyDependencyResolver.java:89)
> at
> org.robolectric.plugins.DefaultSdkProvider$DefaultSdk.getJarPath(DefaultSdkProvider.java:148)
> at
> org.robolectric.internal.AndroidSandbox$SdkSandboxClassLoader.<init>(AndroidSandbox.java:128)
> at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method) at
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
> at
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
> at org.robolectric.util.inject.Injector.inject(Injector.java:250) at
> org.robolectric.util.inject.Injector.lambda$memoized$1(Injector.java:232)
> at
> org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
> at
> org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
> at
> org.robolectric.util.inject.Injector.resolveDependencies(Injector.java:296)
> at org.robolectric.util.inject.Injector.inject(Injector.java:248) at
> org.robolectric.util.inject.Injector.lambda$memoized$1(Injector.java:232)
> at
> org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
> at
> org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
> at
> org.robolectric.util.inject.Injector.getInstance(Injector.java:208)
> at org.robolectric.util.inject.Injector.access$700(Injector.java:96)
> at
> org.robolectric.util.inject.Injector$ScopeBuilderProvider.create(Injector.java:564)
> at
> org.robolectric.util.inject.Injector$ScopeBuilderProvider.lambda$get$0(Injector.java:547)
> at jdk.proxy3/jdk.proxy3.$Proxy24.build(Unknown Source) at
> org.robolectric.internal.SandboxManager.getAndroidSandbox(SandboxManager.java:62)
> at
> org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:299)
> at
> org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:66)
> at
> org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:244)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
> at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
> at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) at
> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) at
> org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) at
> org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:101)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:413) at
> androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
> at
> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:108)
> at
> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
> at
> org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:40)
> at
> org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:60)
> at
> org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:52)
> at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method) at
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
> at
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:568) at
> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
> at
> org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
> at
> org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
> at
> org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
> at jdk.proxy1/jdk.proxy1.$Proxy2.processTestClass(Unknown Source) at
> org.gradle.api.internal.tasks.testing.worker.TestWorker$2.run(TestWorker.java:176)
> at
> org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:129)
> at
> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:100)
> at
> org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:60)
> at
> org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
> at
> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:113)
> at
> org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:65)
> at
> worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
> at
> worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)
答案1
得分: 1
您似乎遇到了一个已知的问题,该问题已经在guava的com.google.common.io.Files.createTempDir中得到修复,该修复已包含在guava 32.0.1版本中发布。
英文:
You seem to have hit an known - and fixed - issue in guava's com.google.common.io.Files.createTempDir, which was released with guava 32.0.1.
So I'd assume tweaking your dependencies to force guava to 32.0.1 (or later) should fix this.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论