accessing to classes of app from dex file by classloader

后端 未结 3 625
南笙
南笙 2021-02-06 16:13

I have a app that recieve a dex file from server then save it on sdcard and load it for

doing some functions.I am loading a my app\'s class from my dex file as followi

3条回答
  •  你的背包
    2021-02-06 17:06

    @zohreh Replace the below line

    final DexClassLoader classloader = new DexClassLoader(libPath, tmpDir.getAbsolutePath(), null, this.getClass().getClassLoader());
    

    to

    final DexClassLoader classloader = new DexClassLoader(libPath, tmpDir.getAbsolutePath(), null, ClassLoader.getSystemClassLoader());
    

提交回复
热议问题