Ошибка макета: java.lang.VerifyError: конструктор должен вызвать super() или this() перед возвратомAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Ошибка макета: java.lang.VerifyError: конструктор должен вызвать super() или this() перед возвратом

Сообщение Anonymous »

Когда я попытался обновить targetdkversion до 35, в моке модульного теста возникли проблемы, и при выполнении «private val context =ockk()» сообщалось о следующей ошибке

Код: Выделить всё

Nov 08, 2024 4:13:21 PM io.mockk.impl.log.JULLogger warn
WARNING: Failed to transform class android/content/Context
java.lang.VerifyError: Constructor must call super() or this() before return
Exception Details:
Location:
android/content/Context.()V @21: return
Reason:
Error exists in the bytecode
Bytecode:
0000000: 1304 f2c0 04f4 4dbb 036b 5913 036d b703
0000010: 702c 0304 54b1

at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3297)
at java.base/java.lang.Class.getDeclaredFields(Class.java:2371)
at net.bytebuddy.description.type.TypeDescription$ForLoadedType.getDeclaredFields(TypeDescription.java:8937)
at net.bytebuddy.dynamic.scaffold.InstrumentedType$Factory$Default$1.represent(InstrumentedType.java:436)
at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:886)
at net.bytebuddy.ByteBuddy.redefine(ByteBuddy.java:861)
at io.mockk.proxy.jvm.transformation.InliningClassTransformer.transform(InliningClassTransformer.kt:74)
at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244)
at java.instrument/sun.instrument.TransformerManager.transform(TransformerManager.java:188)
at java.instrument/sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:541)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses0(Native Method)
at java.instrument/sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:169)
at io.mockk.proxy.jvm.transformation.JvmInlineInstrumentation.retransform(JvmInlineInstrumentation.kt:28)
at io.mockk.proxy.common.transformation.RetransformInlineInstrumentation$execute$1.invoke(RetransformInlineInstrumentation.kt:19)
at io.mockk.proxy.common.transformation.RetransformInlineInstrumentation$execute$1.invoke(RetransformInlineInstrumentation.kt:16)
at io.mockk.proxy.common.transformation.ClassTransformationSpecMap.applyTransformation(ClassTransformationSpecMap.kt:41)
at io.mockk.proxy.common.transformation.RetransformInlineInstrumentation.execute(RetransformInlineInstrumentation.kt:16)
at io.mockk.proxy.jvm.ProxyMaker.inline(ProxyMaker.kt:90)
at io.mockk.proxy.jvm.ProxyMaker.proxy(ProxyMaker.kt:34)
at io.mockk.impl.instantiation.JvmMockFactory.newProxy(JvmMockFactory.kt:34)
at io.mockk.impl.instantiation.AbstractMockFactory.newProxy$default(AbstractMockFactory.kt:24)
at io.mockk.impl.instantiation.AbstractMockFactory.mockk(AbstractMockFactory.kt:59)

Я пытаюсь обновить версию макета до последней версии 1.13.13, но это не работает
Надеюсь на помощь, спасибо

Подробнее здесь: https://stackoverflow.com/questions/791 ... this-befor
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»