Google Drive API doesn't play well with ProGuard (NPE)

后端 未结 6 877
渐次进展
渐次进展 2020-11-30 04:06

Currently, I\'m having experience that, a piece of code, which makes use of Google Drive API is running fine without introducing ProGuard.

However,

6条回答
  •  感情败类
    2020-11-30 04:36

    First -keeping a class does not mean to not touch it. It means do not change its name, and use it as a basis for determining if other classes are not referenced & can be deleted.

    Optimization still occurs, which is likely your problem. Next step I would do is try with: -dontoptimize

    This should cause your other optimizations to be ignored.

    BTW, not sure what version of SDK you are using. Am using 15, 20 is latest, and a proguard-project.txt file is create with the project. The optimization options it uses is:

    -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
    

    If turning off optimization gets it running, maybe turning off all the optimizations (that's what ! does) the SDK does, will allow you to do optimization as well.

提交回复
热议问题