Code Monkey home page Code Monkey logo

Comments (2)

shifujun avatar shifujun commented on July 19, 2024

像这样的问题,对于shadow来说首先要在AOSP的系统上测试复现。因为shadow主要是立足于公开api实现的。确实有原版系统上没问题,但是到了一些oem系统上不兼容的情况。

我最近手边没有电脑适合测试这个问题。

注意到not instance of 'Reference: android.app.Activity'这样的报错。因为shadow处理的插件中是不会有android.app.Activity这个类型出现的。所有它出现就说明这里发生了超出Java范畴的问题。一般就是AOT相关实现造成的了。我的猜测是系统有私有的逻辑,认为我们的插件activity不可能不是android.app.Activity,所有直接把它作为android.app.Activity处理了。但我还猜不出来系统是根据什么推测的。如果只有某几个用例会复现问题,那可能是一些系统API造成的。可能是某个API我们是在Context类型上调用的,但你测试的系统上是在Activity类型上实现的,并且还是AOT实现的,所以它认为传来的this应该是个android.app.Activity。如果是这种情况,又非要兼容的话,我们就得看看改为在宿主container activity上调用可否满足需求了。

这种AOT实现的行为在debug版APP上不生效是我可以确定的,有经验的场景。应该和R8之类的没有关系。

from shadow.

tkkcc avatar tkkcc commented on July 19, 2024

可以在 AVD android13(google play) 上复现

from shadow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.