ClassNotFoundException for a ContentProvider

后端 未结 6 1990
情深已故
情深已故 2021-01-02 01:53

I have a ContentProvider class and is declared in AndroidMenifest.xml like this:



        
6条回答
  •  耶瑟儿~
    2021-01-02 02:18

    This sounds similar to an issue I had that was caused by an issue with the ClassLoader, see here: Bizarre behaviour when using Apache Commons lib in Android

    This bug discusses an error relating to the class loader failing sometimes. The fix for me was to add this line:

    Thread.currentThread().setContextClassLoader(this.getClassLoader());

    in the constructor of the class that was calling the code that was failing.

提交回复
热议问题