After upgrading to Android gradle plugin 2.2.0 (and Android Studio 2.2) I've been having trouble reading from a zip file which is located at app/src/main/assets/magic_info.zip
It used to work fine with plugin versions 2.1.3 and prior but now it throws the following exception
java.io.FileNotFoundException: magic_info.zip
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:334)
at android.content.res.AssetManager.open(AssetManager.java:308)
for some reason it can't find the file from assets which is otherwise there.
Here is my code that used to work in the past.
public static ZipInputStream getZipInputStream(Context context)
{
try
{
return new ZipInputStream(context.getAssets().open("magic_info.zip"));
}
catch (IOException e)
{
e.printStackTrace();
}
return null;
}
Any idea what's wrong with this? Am I missing something?