Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io.FileNotFoundException on Android Studio 2.2 Preview 3 #310

Closed
AndroidGecko opened this issue Jun 9, 2016 · 5 comments
Closed

java.io.FileNotFoundException on Android Studio 2.2 Preview 3 #310

AndroidGecko opened this issue Jun 9, 2016 · 5 comments

Comments

@AndroidGecko
Copy link

AndroidGecko commented Jun 9, 2016

getting stacktrace

System.err  W  java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
                         W      at android.content.res.AssetManager.openAssetFd(Native Method)
                         W      at android.content.res.AssetManager.openFd(AssetManager.java:329)
                         W      at pl.droidsonroids.gif.GifDrawable.<init>(GifDrawable.java:110)

on Android Studio 2.2 Preview 3
unzipped apk to check if gifs were manipulated but they are the same. Even without using :

android {
    aaptOptions {
        noCompress "gif"
    }
}

Went back to AS 2.1.2 and everything works.

Anyone else having this issue?

@koral--
Copy link
Owner

koral-- commented Jun 9, 2016

I've managed to reproduce this issue in AS 2.1.2 when using current alpha android gradle plugin (version 2.2.0-alpha3).
Workaround is to use earlier working version of the plugin eg.:
classpath 'com.android.tools.build:gradle:2.2.0-alpha2'.

@koral-- koral-- closed this as completed Jun 9, 2016
@DanielS1980
Copy link

DanielS1980 commented Jul 7, 2016

Hi,

I see the thread is closed but the bug ate a few of my project's days so i feel like sharing the solution.
Bug can be reproduced when you use "getAssets().openFD".
Error is indeed: "FileNotFoundException"

  1. Goto your project folder "...\MyProject".
  2. Search for "build.gradle" file.
  3. Replace
    classpath 'com.android.tools.build:gradle:2.2.0-alpha3'
    with
    classpath 'com.android.tools.build:gradle:2.1.0'

2.1.0 worked for me.

@koral--
Copy link
Owner

koral-- commented Jul 8, 2016

All versions below 2.2.0-alpha3 should work. The newest stable (non-alpha) is currently 2.1.2.

@faruktoptas
Copy link

faruktoptas commented Oct 11, 2016

I faced the same problem. Downgrading gradle version from 2.2.0 to 2.1.2 solved the problem.

@koral--
Copy link
Owner

koral-- commented Oct 11, 2016

It seems that 2.2.0 (final, no alpha nor beta) and 2.2.1 are not affected by this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants