no method with name='getCodeCacheDir' after implementing Firebase

Recently I added Firebase to Unity project. Project is built perfectly but when I run project on Android device it crashes and exception is :

java.lang.NoSuchMethodError: no method with name=‘getCodeCacheDir’ signature=‘()Ljava/io/File;’ in class Landroid/app/Activity;
at java.lang.Runtime.nativeLoad(Native Method)
at java.lang.Runtime.doLoad(
at java.lang.Runtime.load(
at java.lang.System.load(
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.a(Unknown Source)
at com.unity3d.player.UnityPlayer$b$1.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at com.unity3d.player.UnityPlayer$ Source)

According to the documentation (here), this method was added in API level 21 (Android 5.0).
If you are running on an older device this call will fail, as this method doesn’t exist.

Make sure play-services files are included in Assets/Plugins/Android directory
and check Stripping Level settings in File/Build Settings/ Optimization /Stripping Level
Set it to disabled, otherwise firebase libraries are not included (it happend to me)