Error Running splashActivity Test #5539
Answered
by
theMr17
Zaid-0504
asked this question in
Q&A (Installation)
-
Operating SystemWindows Android Studio VersionAndroid Studio Bumblebee | 2021.1.1 Patch 3 RAM size8Gb Free disk space700 Gb Which step are you stuck on?I am running Robolectric Tests on SplashActivity Test but 0 test are passed i have been following the wiki page https://github.com/oppia/oppia-android/wiki/Installing-Oppia-Android Error Log"C:\Program Files\Java\jdk-11\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Program Files\Android\Android Studio\lib\idea_rt.jar=51742:C:\Program Files\Android\Android Studio\bin" -Dfile.encoding=UTF-8 "@C:\Users\ZAIDMA~1\AppData\Local\Temp\idea_arg_file413351792" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.oppia.android.app.splash.SplashActivityTest
java.lang.TypeNotPresentException: Type [unknown] not present
at java.base/java.lang.reflect.Method.getDefaultValue(Method.java:682)
at java.base/sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:132)
at java.base/sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:85)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:267)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
at java.base/java.lang.Class.createAnnotationData(Class.java:3757)
at java.base/java.lang.Class.annotationData(Class.java:3746)
at java.base/java.lang.Class.getAnnotation(Class.java:3651)
at com.intellij.junit4.JUnit4TestRunnerUtil.buildRequest(JUnit4TestRunnerUtil.java:213)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:47)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:221)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.lang.NoClassDefFoundError: android/app/Application
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at java.base/sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114)
at java.base/sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125)
at java.base/sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49)
at java.base/sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:440)
at java.base/sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:421)
at java.base/sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:350)
at java.base/java.lang.reflect.Method.getDefaultValue(Method.java:674)
... 13 more
Caused by: java.lang.ClassNotFoundException: android.app.Application
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 31 more
Process finished with exit code -2 Approaches already used to resolve the issueNo response Additional information |
Beta Was this translation helpful? Give feedback.
Answered by
theMr17
Sep 21, 2024
Replies: 1 comment 1 reply
-
Hi @Zaid-0504, Instead of running the test on Robolectric following the steps you mentioned, could you please do the following:
Let us know if you have any questions! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
theMr17
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Zaid-0504,
Instead of running the test on Robolectric following the steps you mentioned, could you please do the following:
org.gradle.java.home=C\:\\Users\\<username>\\.jdks\\corretto-11.0.21
to yourgradle.properties
file. (Note: Update the path with your JDK location.)Let us know if you have any questions!