android开发的问题记录

  1. button靠右: hrizontal布局的多个button,将某个button靠右,设置其margin外边距为需要的值即可
    更多控制布局说明:
    https://www.jianshu.com/p/2d6d00b48074

  2. 报错: Cannot fit requested classes in a single dex file (# methods: 72730 > 65536

build.gradle

defaultConfig {
        ...
        multiDexEnabled true
    }

高德导航SDK,退出导航时,报错如下, 增加 android:allowNativeHeapPointerTagging=“false” 解决

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Xiaomi/renoir/renoir:12/SKQ1.211006.001/V13.0.9.0.SKICNXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-10-10 22:45:43.967434016+0800
Process uptime: 0s
Cmdline: cn.xxx.earthwork
pid: 17789, tid: 18013, name: GLThread 84  >>> cn.xxx.earthwork <<<
uid: 10000
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'Pointer tag for 0x780614f6f0 was truncated, see 'https://source.android.com/devices/tech/debug/tagged-pointers'.'
    x0  0000000000000000  x1  000000000000465d  x2  0000000000000006  x3  00000076c2037e10
    x4  8080808080808080  x5  8080808080808080  x6  8080808080808080  x7  8080808080808080
    x8  00000000000000f0  x9  ef701dfff317bfbc  x10 0000000000000000  x11 ffffff80fffffbdf
    x12 0000000000000001  x13 00000b1904873034  x14 0027c6b88d9ef369  x15 0000000000000048
    x16 00000079477abd30  x17 0000007947785650  x18 00000076c2037bc0  x19 000000000000457d
    x20 000000000000465d  x21 00000000ffffffff  x22 0000000000002711  x23 b4000076d7558d40
    x24 00000076c2039000  x25 00000076e04f1b30  x26 00000076c2039000  x27 00000076c2039000
    x28 00000076c20383e0  x29 00000076c2037e90
    lr  00000079477359fc  sp  00000076c2037df0  pc  0000007947735a28  pst 0000000000001000
backtrace:
      #00 pc 000000000008aa28  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 94065bf91428f6ae9fb310c478171302)
      #01 pc 0000000000047c4c  /apex/com.android.runtime/lib64/bionic/libc.so (free+108) (BuildId: 94065bf91428f6ae9fb310c478171302)
      #02 pc 00000000014a3d8c  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #03 pc 00000000014a374c  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #04 pc 000000000149f718  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #05 pc 000000000108f0a8  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #06 pc 0000000001052cc0  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #07 pc 0000000001107450  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #08 pc 0000000001106f18  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #09 pc 0000000001106d8c  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #10 pc 00000000010770b8  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #11 pc 00000000003a2474  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #12 pc 00000000003a2720  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #13 pc 00000000003cf318  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #14 pc 00000000003b9a44  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #15 pc 000000000023fb30  /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/lib/arm64/libAMapSDK_NAVI_v9_3_0.so (Java_com_autonavi_base_ae_gmap_GLMapEngine_nativeDestroy+72) (BuildId: 30713a8a9a531b6343e449e69fe0aaa358d43926)
      #16 pc 0000000000222244  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+148) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #17 pc 0000000000211d0c  /apex/com.android.art/lib64/libart.so (nterp_helper+1948) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #18 pc 00000000004eabe8  [anon:dalvik-classes.dex extracted in memory from /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/base.apk]
      #19 pc 00000000002124c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #20 pc 0000000000437bf6  [anon:dalvik-classes.dex extracted in memory from /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/base.apk]
      #21 pc 00000000002124c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #22 pc 0000000000424b9c  [anon:dalvik-classes.dex extracted in memory from /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/base.apk]
      #23 pc 00000000002132e4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #24 pc 0000000000459238  [anon:dalvik-classes.dex extracted in memory from /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/base.apk]
      #25 pc 00000000002124c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #26 pc 00000000004594de  [anon:dalvik-classes.dex extracted in memory from /data/app/~~C6sV1slwNjFzKVegEVN5Uw==/cn.xxx.earthwork-RiyG4YWKOSTyvGT3I9RpCw==/base.apk]
      #27 pc 0000000000218964  /apex/com.android.art/lib64/libart.so (art_quick_invoke_stub+548) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #28 pc 0000000000285ff0  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+192) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #29 pc 000000000062dec0  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeVirtualOrInterfaceWithJValues<art::ArtMethod*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, art::ArtMethod*, jvalue const*)+464) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #30 pc 000000000067dd9c  /apex/com.android.art/lib64/libart.so (art::Thread::CreateCallback(void*)+1188) (BuildId: 824f7ca55f9cdc7b2f2fa3478577b69e)
      #31 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: 94065bf91428f6ae9fb310c478171302)
      #32 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: 94065bf91428f6ae9fb310c478171302)

AndroidManifest.xml

   <application
        android:requestLegacyExternalStorage="true"
        android:usesCleartextTraffic="true"
        android:allowNativeHeapPointerTagging="false"
        android:label="xxx"
        android:icon="@mipmap/ic_launcher">
  1. 安卓非主线程(异步线程)如何调用Toast
Looper.prepare();
Toast.makeText(getBaseContext(), "text", Toast.LENGTH_LONG).show();
Looper.loop();
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值