当前位置: 首页 > 知识库问答 >
问题:

在Android

赵雅懿
2023-03-14

我有一些android测试,当运行在4.4/kitkat以下的android版本上时,会很难崩溃。

这些是我在大楼里的图书馆

androidTestCompile 'org.mockito:mockito-core:1.9.5'
androidTestCompile 'com.google.dexmaker:dexmaker:1.1'
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.1'

测试在Android4.4版上运行,虽然我需要添加一些提示来告诉Dexmaker将其缓存放在哪里:

System.setProperty("dexmaker.dexcache", getInstrumentation().getContext().getCacheDir().getPath());

以下是器件的logcat输出:

D/dalvikvm( 1712): GC_FOR_ALLOC freed 479K, 19% free 2532K/3124K, paused 3ms, total 3ms
D/dalvikvm( 1712): GC_CONCURRENT freed 427K, 18% free 2595K/3136K, paused 1ms+0ms, total 3ms
D/dalvikvm( 1712): GC_CONCURRENT freed 311K, 16% free 2686K/3188K, paused 3ms+0ms, total 4ms
D/dalvikvm( 1712): GC_FOR_ALLOC freed 127K, 11% free 2852K/3188K, paused 1ms, total 1ms
D/dalvikvm( 1712): GC_FOR_ALLOC freed 123K, 7% free 3239K/3476K, paused 4ms, total 4ms
D/dalvikvm( 1712): GC_CONCURRENT freed 53K, 6% free 3276K/3476K, paused 2ms+0ms, total 10ms
D/dalvikvm( 1712): DexOpt: --- BEGIN 'Generated-1815896169.jar' (bootstrap=0) ---
D/dalvikvm( 1728): DexOpt: load 1ms, verify+opt 0ms, 82180 bytes
D/dalvikvm( 1712): DexOpt: --- END 'Generated-1815896169.jar' (success) ---
D/dalvikvm( 1712): DEX prep '/data/data/my.app.identifier/cache/Generated-1815896169.jar': unzip in 0ms, rewrite 15ms
I/dalvikvm( 1712): DexOpt: illegal method access (call Ljava/lang/Object;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object; from LBackendAddressServiceImpl_Proxy;)
I/dalvikvm( 1712): Could not find method my.app.identifier.backend.BackendAddressServiceImpl.internalClone, referenced from method BackendAddressServiceImpl_Proxy.internalClone
W/dalvikvm( 1712): VFY: unable to resolve virtual method 50: Lmy/app/identifier/backend/BackendAddressServiceImpl;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object;
D/dalvikvm( 1712): VFY: replacing opcode 0x6f at 0x0019
I/dalvikvm( 1712): DexOpt: illegal method access (call Ljava/lang/Object;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object; from LBackendAddressServiceImpl_Proxy;)
I/dalvikvm( 1712): Could not find method my.app.identifier.backend.BackendAddressServiceImpl.internalClone, referenced from method BackendAddressServiceImpl_Proxy.super$internalClone$java_lang_Object
W/dalvikvm( 1712): VFY: unable to resoldlve virtual method 50: Lmy/app/identifier/backend/BackendAddressServiceImpl;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object;
D/dalvikvm( 1712): VFY: replacing opcode 0x6f at 0x0000
D/dalvikvm( 1712): GC_FOR_ALLOC freed 652K, 20% free 3138K/3904K, paused 4ms, total 4ms
D/dalvikvm( 1712): DexOpt: --- BEGIN 'Generated1066861752.jar' (bootstrap=0) ---
D/dalvikvm( 1712): GC_CONCURRENT freed 44K, 21% free 3103K/3904K, paused 0ms+1ms, total 2ms
D/dalvikvm( 1729): DexOpt: load 0ms, verify+opt 0ms, 81004 bytes
D/dalvikvm( 1712): DexOpt: --- END 'Generated1066861752.jar' (success) ---
D/dalvikvm( 1712): DEX prep '/data/data/my.app.identifier/cache/Generated1066861752.jar': unzip in 0ms, rewrite 13ms
I/dalvikvm( 1712): DexOpt: illegal method access (call Ljava/lang/Object;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object; from LAppConfigServiceImpl_Proxy;)
I/dalvikvm( 1712): Could not find method my.app.identifier.config.AppConfigServiceImpl.internalClone, referenced from method AppConfigServiceImpl_Proxy.internalClone
W/dalvikvm( 1712): VFY: unable to resolve virtual method 17: Lmy/app/identifier/config/AppConfigServiceImpl;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object;
D/dalvikvm( 1712): VFY: replacing opcode 0x6f at 0x0019
I/dalvikvm( 1712): DexOpt: illegal method access (call Ljava/lang/Object;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object; from LAppConfigServiceImpl_Proxy;)
I/dalvikvm( 1712): Could not find method my.app.identifier.config.AppConfigServiceImpl.internalClone, referenced from method AppConfigServiceImpl_Proxy.super$internalClone$java_lang_Object
W/dalvikvm( 1712): VFY: unable to resolve virtual method 17: Lmy/app/identifier/config/AppConfigServiceImpl;.internalClone (Ljava/lang/Cloneable;)Ljava/lang/Object;
D/dalvikvm( 1712): VFY: replacing opcode 0x6f at 0x0000
D/dalvikvm( 1712): GC_CONCURRENT freed 536K, 22% free 3078K/3904K, paused 1ms+1ms, total 7ms
D/dalvikvm( 1712): WAIT_FOR_CONCURRENT_GC blocked 3ms
D/dalvikvm( 1712): GC_FOR_ALLOC freed 492K, 21% free 3098K/3904K, paused 2ms, total 2ms
D/dalvikvm( 1712): GC_FOR_ALLOC freed 468K, 20% free 3142K/3904K, paused 2ms, total 2ms
D/dalvikvm( 1712): GC_CONCURRENT freed 247K, 19% free 3174K/3904K, paused 2ms+0ms, total 4ms
F/libc    ( 1712): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 1725 (ationTestRunner)
I/DEBUG   (  109): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  109): Build fingerprint: 'generic/vbox86p/vbox86p:4.2.2/JDQ39E/eng.buildbot.20140523.235904:userdebug/test-keys'
I/DEBUG   (  109): Revision: '0'
I/DEBUG   (  109): pid: 1712, tid: 1725, name: ationTestRunner  >>> my.app.identifier 
I/DEBUG   (  109): 
I/DEBUG   (  109): stack:
I/DEBUG   (  109):          98c5bba0  00000000  
I/DEBUG   (  109):          98c5bba4  00000000  
I/DEBUG   (  109):          98c5bba8  00000000  
I/DEBUG   (  109):          98c5bbac  00000000  
I/DEBUG   (  109):          98c5bbb0  00000000  
I/DEBUG   (  109):          98c5bbb4  00000000  
I/DEBUG   (  109):          98c5bbb8  00000000  
I/DEBUG   (  109):          98c5bbbc  00000000  
I/DEBUG   (  109):          98c5bbc0  00000000  
I/DEBUG   (  109):          98c5bbc4  00000000  
I/DEBUG   (  109):          98c5bbc8  00000000  
I/DEBUG   (  109):          98c5bbcc  00000000  
I/DEBUG   (  109):          98c5bbd0  00000000  
I/DEBUG   (  109):          98c5bbd4  00000000  
I/DEBUG   (  109):          98c5bbd8  00000000  
I/DEBUG   (  109):          98c5bbdc  00000000  
I/DEBUG   (  109):     #00  98c5bbe0  a652fb68  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bbe4  a6487fe8  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bbe8  a647f1c0  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bbec  b66af3d1  /system/lib/libdvm.so (dvmRemoveFromReferenceTable(ReferenceTable*, Object**, Object*)+33)
I/DEBUG   (  109):          98c5bbf0  b6752ca0  /system/lib/libdvm.so
I/DEBUG   (  109):          98c5bbf4  b6751ff4  /system/lib/libdvm.so
I/DEBUG   (  109):          98c5bbf8  00000000  
I/DEBUG   (  109):          98c5bbfc  b66b3fd4  /system/lib/libdvm.so (dvmThreadSelf()+36)
I/DEBUG   (  109):          98c5bc00  00000007  
I/DEBUG   (  109):          98c5bc04  a652fc08  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bc08  a647f198  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bc0c  b6751ff4  /system/lib/libdvm.so
I/DEBUG   (  109):          98c5bc10  b7d30a28  [heap]
I/DEBUG   (  109):          98c5bc14  a647f180  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          98c5bc18  98c5bcb8  [stack:1725]
I/DEBUG   (  109):          98c5bc1c  b66ba5b7  /system/lib/libdvm.so (dvmReleaseTrackedAlloc+71)
I/DEBUG   (  109):          ........  ........
I/DEBUG   (  109):     #01  98c5bcc0  b7d30a28  [heap]
I/DEBUG   (  109):          98c5bcc4  00000000  
I/DEBUG   (  109):          98c5bcc8  00000000  
I/DEBUG   (  109):          98c5bccc  00000000  
I/DEBUG   (  109):          98c5bcd0  00000000  
I/DEBUG   (  109):          98c5bcd4  b6751ff4  /system/lib/libdvm.so
I/DEBUG   (  109):          98c5bcd8  b7d30a28  [heap]
I/DEBUG   (  109):          98c5bcdc  b665bd72  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+178)
I/DEBUG   (  109):          98c5bce0  b7d30a28  [heap]
I/DEBUG   (  109):          98c5bce4  00000000  
I/DEBUG   (  109):          98c5bce8  b7596339  /system/lib/libc.so (pthread_mutex_lock+9)
I/DEBUG   (  109):          98c5bcec  b761eff4  /system/lib/libc.so
I/DEBUG   (  109):          98c5bcf0  b7cf4e98  [heap]
I/DEBUG   (  109):          98c5bcf4  00000018  
I/DEBUG   (  109):          98c5bcf8  b7cf4e68  [heap]
I/DEBUG   (  109):          98c5bcfc  b7596509  /system/lib/libc.so (pthread_mutex_unlock+25)
I/DEBUG   (  109):          ........  ........
I/DEBUG   (  109):     #02  b7d30a30  9f27f620  /dev/ashmem/dalvik-LinearAlloc (deleted)
I/DEBUG   (  109):          b7d30a34  9eee8000  /dev/ashmem/dalvik-aux-structure (deleted)
I/DEBUG   (  109):          b7d30a38  a647f180  /dev/ashmem/dalvik-heap (deleted)
I/DEBUG   (  109):          b7d30a3c  00000000  
I/DEBUG   (  109):          b7d30a40  98c5bc70  [stack:1725]
I/DEBUG   (  109):          b7d30a44  00000000  
I/DEBUG   (  109):          b7d30a48  98c5bd1c  [stack:1725]
I/DEBUG   (  109):          b7d30a4c  0000000a  
I/DEBUG   (  109):          b7d30a50  00000000  
I/DEBUG   (  109):          b7d30a54  b665611c  /system/lib/libdvm.so
I/DEBUG   (  109):          b7d30a58  00000000  
I/DEBUG   (  109):          b7d30a5c  00000000  
I/DEBUG   (  109):          b7d30a60  9edb6670  /system/framework/ext.jar
I/DEBUG   (  109):          b7d30a64  98c5c300  
I/DEBUG   (  109):          b7d30a68  00000000  
I/DEBUG   (  109):          b7d30a6c  00000000  
D/AndroidRuntime( 1704): Shutting down VM
I/ActivityManager(  464): Process my.app.identifier (pid 1712) has died.
W/ActivityManager(  464): Crash of app my.app.identifier running instrumentation ComponentInfo{my.app.identifier.test/android.test.InstrumentationTestRunner}
D/dalvikvm( 1704): GC_CONCURRENT freed 100K, 19% free 462K/568K, paused 0ms+0ms, total 2ms
D/jdwp    ( 1704): Got wake-up signal, bailing out of select
D/dalvikvm( 1704): Debugger has detached; object registry had 1 entries
I/ActivityManager(  464): Force stopping package my.app.identifier appid=10048 user=0
D/Zygote  (  198): Process 1712 terminated by signal (11)
W/ThrottleService(  464): unable to find stats for iface rmnet0

在“老”的Android版本上运行Mockito/Dexmaker有什么提示吗?

共有1个答案

危宜
2023-03-14

我不是百分之百,如果它做到了(或其他东西,我们在此期间改变),但在DexMaker1.2这似乎是固定的。

 类似资料:
  • 问题内容: 我正在寻找最快和正确的方法来检查数据库中是否存在记录: 您有任何问题吗? 问题答案: 考虑那是你的课 我将您的参数保留为a,但我认为应该将其作为。 它比因为不需要在select子句中从表中检索所有值而更快。 您可以将字符串放入静态最终常量中,以使其更快。

  • 我想在flutter中使用local_auth插件,而且它需要Android生命周期,所以我安装了flutter_plugin_android_lifecycle,但是如果我尝试发布apk:error:package androidx.lifecycle不存在,我就会得到这个错误。我试了很多东西,但就是不能让它起作用。 ''C:\flutter.pub-cache\hosted\pub.dartl

  • 在我的应用程序中,我想在ImageView上画一条线。当我触摸它时,我想用手指写一条线。这是我的要求。为此,我谷歌了很多次,并休耕了贝娄链接: 如何在Android上的ImageView中画一条线?。 在我的活动中,我创建了MyImageView类的对象,在我的OnTouchListener中重写了onTouch()方法,在MotionEvent.action_down:switch case中,

  • 问题内容: 我最近将android studio IDE更新为0.8,以与新的android L SDK一起使用。首先,我导入了一个完成的android项目,该项目在较旧版本的android studio中没有收到任何错误。在版本0.8中,i行例如 get:无法解决支持,导致其余代码出错。logcat返回101个实例 每次在import语句中调用支持库时都为1。 我试过了 重新安装IDE 删除想法

  • 我用java加密一个单词,但用php解密时遇到了问题。 以下是我如何在android中创建密钥: 下面是我如何在android中使用生成的公钥加密单词: 然后我在android中将加密字符串转换为Bas64: 在php中,我解码base64字符串: 获取私钥: 最后,我尝试用php解密这个字符串: 我得到的错误是: 警告:openssl_private_decrypt():密钥参数不是有效的私钥.

  • 我一直试图在RealmObject中查询RealmList,但我总是遇到以下错误: 无效查询:类“ClassRealm”中的字段“field_obbject”的类型“STRING_LIST”无效。 如何基于RealmList元素进行查询?检查这是不是空的?检查其中一个字符串是否等于“任意字符串”?? 我一直在使用Realm.contains(),但它返回此错误。 更新: 所以CarRealm拥有众