微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Android Room:应用程序突然崩溃致命信号11SIGSEGV,代码1SEGV_MAPERR,错误地址0x0

如何解决Android Room:应用程序突然崩溃致命信号11SIGSEGV,代码1SEGV_MAPERR,错误地址0x0

我的问题是,我的应用突然崩溃了,我也不知道为什么。这种情况不定期发生,但我认为这与我的房间数据库有关。我尝试提供尽可能多的信息:

数据库

@Database(entities = [ProductCacheEntity::class],version = 1)
@TypeConverters(Converters::class)
abstract class ShoppingCartDatabase : RoomDatabase() {
    abstract fun shopDao(): ShoppingCartDao

    companion object {
        const val DATABASE_NAME = "shop_db"
    }
}

DAO

@Dao
interface ShoppingCartDao {
    @Insert(onConflict = OnConflictStrategy.IGnorE)
    suspend fun insert(productCacheEntity: ProductCacheEntity): Long

    @Transaction
    suspend fun upsert(productCacheEntity: ProductCacheEntity) {
        val id = insert(productCacheEntity)
        if (productExists(id)) increaseQuantityById(productCacheEntity.id)
    }

    @Query("UPDATE products SET quantity = quantity + 1 WHERE ID = :id")
    suspend fun increaseQuantityById(id: Int)

    @Query("UPDATE products SET quantity = quantity - 1 WHERE ID = :id")
    suspend fun decreaseQuantityById(id: Int)

    @Query("DELETE FROM products WHERE id = :id")
    suspend fun deleteProductById(id: Int)

    @Query("SELECT * FROM products")
    fun getAllProducts(): LiveData<List<ProductCacheEntity>>

    @Query("SELECT SUM(price * quantity) FROM products")
    fun getSummedPrice(): LiveData<Float>

    private fun productExists(id: Long): Boolean = id == -1L
}

片段

@AndroidEntryPoint
class ShoppingCartFragment(
    private val shoppingCartAdapter: ShoppingCartlistadapter,private val cacheMapper: ShopCacheMapper
) : Fragment(R.layout.fragment_shopping_cart),ShoppingCartlistadapter.OnItemClickListener {
    private val shoppingCartviewmodel: ShoppingCartviewmodel by viewmodels()
    private val shoppingCartBinding: FragmentShoppingCartBinding by viewBinding()
   // private val shoppingCartAdapter = ShoppingCartlistadapter()

    override fun onViewCreated(view: View,savedInstanceState: Bundle?) {
        super.onViewCreated(view,savedInstanceState)
        shoppingCartAdapter.clickHandler(this)
        bindobjects()
        observeList()
    }

    private fun observeList() {
        shoppingCartviewmodel.productList.observe(viewLifecycleOwner,shoppingCartAdapter::submitList)
    }

    private fun bindobjects() = with(shoppingCartBinding) {
        adapter = shoppingCartAdapter
        viewmodel = shoppingCartviewmodel
        lifecycleOwner = viewLifecycleOwner
    }

    override fun forwardCardClick(productCacheEntity: ProductCacheEntity) {
        val product = cacheMapper.mapFromEntity(productCacheEntity)
        val action = ShoppingCartFragmentDirections.actionShoppingCartFragmentToShopItemFragment(product)
        findNavController().navigate(action)

    }

    override fun fordwardBtnIncreaseClick(id: Int) {
        shoppingCartviewmodel.increaseProductQuantityById(id)
    }

    override fun fordwardBtnDecreaseClick(id: Int) {
        shoppingCartviewmodel.decreaseProductQuantityById(id)
    }

    override fun forwardBtnDeleteClick(id: Int) {
        shoppingCartviewmodel.deleteProductById(id)
    }

    override fun onDestroyView() {
        requireView().findViewById<RecyclerView>(R.id.rv_shopping_cart).adapter = null
        super.onDestroyView()
    }

listadapter

class ShoppingCartlistadapter @Inject constructor() : listadapter<ProductCacheEntity,ShoppingCartlistadapter.ProductViewHolder>(Companion) {
    private lateinit var clickListener: OnItemClickListener

    companion object: DiffUtil.ItemCallback<ProductCacheEntity>() {
        override fun areItemsTheSame(oldItem: ProductCacheEntity,newItem: ProductCacheEntity): Boolean = oldItem.id == newItem.id
        override fun areContentsTheSame(oldItem: ProductCacheEntity,newItem: ProductCacheEntity): Boolean = oldItem == newItem
    }

    inner class ProductViewHolder(val binding: ShoppingCartListItembinding): RecyclerView.ViewHolder(binding.root)

    override fun onCreateViewHolder(parent: ViewGroup,viewType: Int): ProductViewHolder {
        val layoutInflater = LayoutInflater.from(parent.context)
        val binding = ShoppingCartListItembinding.inflate(layoutInflater,parent,false)
        return ProductViewHolder(binding).also {
            with(binding) {
                ivProduct.setonClickListener { clickListener.forwardCardClick(binding.product!!) }
                tvTitle.setonClickListener { clickListener.forwardCardClick(binding.product!!) }
                btnIncrease.setonClickListener { clickListener.fordwardBtnIncreaseClick(binding.product!!.id) }
                btnDecrease.setonClickListener { clickListener.fordwardBtnDecreaseClick(binding.product!!.id) }
                btnDelete.setonClickListener { clickListener.forwardBtnDeleteClick(binding.product!!.id) }
            }
        }
    }

    override fun onBindViewHolder(holder: ProductViewHolder,position: Int) {
        val currentProduct = getItem(position) ?: return
        holder.binding.product = currentProduct
        holder.binding.btnDecrease.isEnabled = currentProduct.quantity > 1
        holder.binding.executePendingBindings()
    }

    interface OnItemClickListener {
        fun forwardCardClick(productCacheEntity: ProductCacheEntity)
        fun fordwardBtnIncreaseClick(id: Int)
        fun fordwardBtnDecreaseClick(id: Int)
        fun forwardBtnDeleteClick(id: Int)
    }

    fun clickHandler(clickEventHandler: OnItemClickListener) {
        clickListener = clickEventHandler
    }
}

viewmodel(从另一个片段在此处添加产品)

class ShopItemviewmodel @viewmodelInject constructor(
    private val shopCacheMapper: ShopCacheMapper,private val shoppingCartDB: ShoppingCartDao
) : viewmodel() {
    fun insertOrUpdateProduct(product: Product) = viewmodelScope.launch {
        val cacheEntity = shopCacheMapper.mapToEntity(product)
        shoppingCartDB.upsert(cacheEntity)
    }
}

viewmodel 2(用于购物车片段)

class ShoppingCartviewmodel @viewmodelInject constructor(
    private val shopDB: ShoppingCartDao
): viewmodel() {
    val productList: LiveData<List<ProductCacheEntity>> = shopDB.getAllProducts()
    val summedPrice: LiveData<Float> = shopDB.getSummedPrice()

    fun increaseProductQuantityById(id: Int) = viewmodelScope.launch {
        shopDB.increaseQuantityById(id)
    }

    fun decreaseProductQuantityById(id: Int) = viewmodelScope.launch {
        shopDB.decreaseQuantityById(id)
    }

    fun deleteProductById(id: Int) = viewmodelScope.launch {
        shopDB.deleteProductById(id)
    }
}

映射器

class ShopCacheMapper @Inject constructor(): EntityMapper<ProductCacheEntity,Product> {
    override fun mapFromEntity(entity: ProductCacheEntity): Product = Product(
        id = entity.id,name = entity.name,price = entity.price,category = entity.category,articelNumber = entity.articelNumber,images = entity.images,description = entity.description,technicalDescription = entity.technicalDescription,hasAccessories = entity.hasAccessories
    )

    override fun mapToEntity(domainModel: Product): ProductCacheEntity = ProductCacheEntity(
        id = domainModel.id,name = domainModel.name,price = domainModel.price,category = domainModel.category,articelNumber = domainModel.articelNumber,images = domainModel.images,description = domainModel.description,technicalDescription = domainModel.technicalDescription,hasAccessories = domainModel.hasAccessories
    )

    override fun mapFromEntityList(entities: List<ProductCacheEntity>): List<Product> = entities.map(::mapFromEntity)
}

Stacktrace one

--------- beginning of crash
2020-10-16 13:09:08.638 11560-11669/com.example.app A/libc: Fatal signal 11 (SIGSEGV),code 1 (SEGV_MAPERR),fault addr 0x40 in tid 11669 (Thread-5),pid 11560 (com.example.app)
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:10/QSR1.200715.002/6695061:userdebug/dev-keys'
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: Revision: '0'
2020-10-16 13:09:08.678 11707-11707/? A/DEBUG: ABI: 'x86'
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Timestamp: 2020-10-16 11:09:08+0000
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: pid: 11560,tid: 11669,name: Thread-5  >>> com.example.app <<<
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: uid: 10133
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: signal 11 (SIGSEGV),fault addr 0x40
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Cause: null pointer dereference
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG: Abort message: 'Check Failed: throw_dex_pc < accessor.InsnsSizeInCodeUnits() (throw_dex_pc=21634,accessor.InsnsSizeInCodeUnits()=0) '
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     eax 00000000  ebx ecfeea74  ecx edfee140  edx f181b801
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     edi bfe10c88  esi d8b6a8a0
2020-10-16 13:09:08.679 11707-11707/? A/DEBUG:     ebp bfe10a38  esp bfe109f0  eip ecf0ec29
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG: backtrace:
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: Function names and BuildId information is missing for some frames due
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: to unreadable libraries. For unwinds of apps,only shared libraries
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: found under the lib/ directory are readable.
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:     NOTE: On this device,run setenforce 0 to make the libraries readable.
2020-10-16 13:09:08.735 11707-11707/? A/DEBUG:       #00 pc 005c5c29  /apex/com.android.runtime/lib/libart.so (art::StackDumpVisitor::StartMethod(art::ArtMethod*,unsigned int)+41) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #01 pc 00491ec0  /apex/com.android.runtime/lib/libart.so (art::MonitorObjectsstackVisitor::VisitFrame()+80) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #02 pc 0058c8f8  /apex/com.android.runtime/lib/libart.so (_ZN3art12StackVisitor9WalkStackILNS0_16CountTransitionsE0EEEvb+2008) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #03 pc 005b6bfe  /apex/com.android.runtime/lib/libart.so (art::Thread::DumpJavaStack(std::__1::basic_ostream<char,std::__1::char_traits<char>>&,bool,bool) const+1022) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #04 pc 005b1fe9  /apex/com.android.runtime/lib/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char,BacktraceMaP*,bool) const+1017) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #05 pc 005ace61  /apex/com.android.runtime/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char,bool) const+65) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #06 pc 005d2cd1  /apex/com.android.runtime/lib/libart.so (art::DumpCheckpoint::Run(art::Thread*)+929) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.736 11707-11707/? A/DEBUG:       #07 pc 005cb034  /apex/com.android.runtime/lib/libart.so (art::ThreadList::runcheckpoint(art::Closure*,art::Closure*)+1556) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #08 pc 005c9be4  /apex/com.android.runtime/lib/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char,bool)+1620) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #09 pc 005796f0  /apex/com.android.runtime/lib/libart.so (art::AbortState::DumpAllThreads(std::__1::basic_ostream<char,art::Thread*) const+448) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #10 pc 00564d30  /apex/com.android.runtime/lib/libart.so (art::Runtime::Abort(char const*)+1536) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #11 pc 000249b3  /apex/com.android.runtime/lib/libartbase.so (_ZNSt3__110__function6__funcIPFvPKcENS_9allocatorIS5_EES4_EclEOS3_+35) (BuildId: b3a3a0a741f44556d02d009140734527)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #12 pc 0000bac7  /system/lib/libbase.so (android::base::LogMessage::~LogMessage()+727) (BuildId: e6c80e0dfebf299cd41f1c732ad018a9)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #13 pc 001b85bc  /apex/com.android.runtime/lib/libart.so (art::ThrowNullPointerExceptionFromDexpc(bool,unsigned int)+499) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #14 pc 00331cf1  /apex/com.android.runtime/lib/libart.so (art::interpreter::ThrowNullPointerExceptionFromInterpreter()+33) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #15 pc 0034055a  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+31834) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #16 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #17 pc 0000170c  [anon:dalvik-/system/framework/framework.jar-transformed-transformed-transformed-transformed]
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #18 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #19 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::CodeItemDataAccessor const&,art::ShadowFrame*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #20 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,false>(art::ArtMethod*,art::Thread*,art::ShadowFrame&,art::Instruction const*,unsigned short,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #21 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #22 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #23 pc 0032f624  /system/framework/framework.jar (android.database.AbstractCursor.movetoPosition)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #24 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #25 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #26 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #27 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #28 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #29 pc 0032f600  /system/framework/framework.jar (android.database.AbstractCursor.movetoNext)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #30 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #31 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #32 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #33 pc 0033ee45  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+25925) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #34 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #35 pc 0002834c  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.sqliteInspector.querySchema)
2020-10-16 13:09:08.737 11707-11707/? A/DEBUG:       #36 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #37 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #38 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #39 pc 0033b651  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+11601) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #40 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #41 pc 00028010  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.sqliteInspector.handleGetSchema)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #42 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #43 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #44 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #45 pc 0033b651  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+11601) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #46 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #47 pc 00028a0c  [anon:dalvik-classes.dex extracted in memory from /data/local/tmp/perfd/sqlite-inspection.jar] (androidx.sqlite.inspection.sqliteInspector.onReceiveCommand)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #48 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #49 pc 002ffe19  /apex/com.android.runtime/lib/libart.so (art::interpreter::ArtInterpreterToInterpreterBridge(art::Thread*,art::JValue*)+217) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #50 pc 0032c17e  /apex/com.android.runtime/lib/libart.so (bool art::interpreter::DoCall<false,art::JValue*)+958) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #51 pc 0033edd3  /apex/com.android.runtime/lib/libart.so (void art::interpreter::ExecuteSwitchImplCpp<false,false>(art::interpreter::SwitchImplContext*)+25811) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #52 pc 00145b52  /apex/com.android.runtime/lib/libart.so (ExecuteSwitchImplAsm+18) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #53 pc 00008a8c  [anon:dalvik-classes.dex extracted in memory from /data/data/com.example.app/code_cache/perfa.jar] (com.android.tools.agent.app.inspection.AppinspectionService.sendCommand)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #54 pc 002f8f92  /apex/com.android.runtime/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadERKNS_20CodeItemDataAccessorERNS_11ShadowFrameENS_6JValueEbb.llvm.1175793267244191248+690) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #55 pc 002ffcc5  /apex/com.android.runtime/lib/libart.so (art::interpreter::EnterInterpreterFromEntryPoint(art::Thread*,art::ShadowFrame*)+181) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #56 pc 0066fc49  /apex/com.android.runtime/lib/libart.so (artQuickToInterpreterBridge+1209) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #57 pc 0014503d  /apex/com.android.runtime/lib/libart.so (art_quick_to_interpreter_bridge+77) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.738 11707-11707/? A/DEBUG:       #58 pc 0013e7d2  /apex/com.android.runtime/lib/libart.so (art_quick_invoke_stub+338) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #59 pc 00149a69  /apex/com.android.runtime/lib/libart.so (art::ArtMethod::Invoke(art::Thread*,unsigned int*,unsigned int,art::JValue*,char const*)+281) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #60 pc 0055a563  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedobjectAccessAlreadyRunnable const&,art::ArtMethod*,art::(anonymous namespace)::ArgArray*,char const*)+99) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #61 pc 0055bcca  /apex/com.android.runtime/lib/libart.so (art::InvokeVirtualOrInterfaceWithVarargs(art::ScopedobjectAccessAlreadyRunnable const&,_jobject*,_jmethodID*,char*)+474) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #62 pc 0040962f  /apex/com.android.runtime/lib/libart.so (art::JNI::CallVoidMethodV(_jnienv*,char*)+943) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #63 pc 003d8f44  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*,_jnienv*,_jclass*,char*,art::Primitive::Type,art::InvokeType)+1700) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #64 pc 003c53f9  /apex/com.android.runtime/lib/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_jnienv*,char*)+73) (BuildId: fe49ff2b6f401678e4775fb2121e4ea4)
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #65 pc 00034a4e  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.739 11707-11707/? A/DEBUG:       #66 pc 000348de  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #67 pc 0008e55d  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #68 pc 0008ec20  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #69 pc 00312a0e  /data/data/com.example.app/code_cache/libjvmtiagent_x86.so
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #70 pc 0011a8e5  /apex/com.android.runtime/lib/bionic/libc.so (__pthread_start(void*)+53) (BuildId: 471745f0fbbcedb3db1553d5bd6fcd8b)
2020-10-16 13:09:08.740 11707-11707/? A/DEBUG:       #71 pc 000af6a7  /apex/com.android.runtime/lib/bionic/libc.so (__start_thread+71) (BuildId: 471745f0fbbcedb3db1553d5bd6fcd8b)
2020-10-16 13:09:09.196 1852-1852/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_02
2020-10-16 13:09:09.307 2068-2176/system_process E/Inputdispatcher: channel '3ea17ad com.example.app/com.example.app.framework.ui.view.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

解决方法

如果我打开数据库检查器,我也会遇到同样的不规则崩溃。我以为问题出在我的代码中,但不是。当我停止使用数据库检查器时,我再也没有遇到这种崩溃

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。