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

Some Images do not render in Android (release mode only) #23022

Closed
zabojad opened this issue Jan 16, 2019 · 3 comments
Closed

Some Images do not render in Android (release mode only) #23022

zabojad opened this issue Jan 16, 2019 · 3 comments
Labels
Bug Component: Image Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@zabojad
Copy link

zabojad commented Jan 16, 2019

Environment

$ react-native info

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: (4) x64 Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
      Memory: 31.45 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
      Android SDK:
        API Levels: 18, 23, 24, 25, 26, 27, 28
        Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.0, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.3
        System Images: a... | Intel x86 Atom_64, a...gle_apis | Google APIs Intel x86 Atom_64 ...
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: 0.57.1 => 0.57.1 
    npmGlobalPackages:
      react-native-app-id: 0.0.4
      react-native-cli: 2.0.1
      react-native-create-library: 3.1.2

Description

For reasons I do not get, I have some png images (every time the exact same ones) that do not get rendered in Android release mode only.
In my sources:

data = [{ pic : require("my-icons/img/menu_01.png"), index : 0},{ pic : require("my-icons/img/menu_02.png"), index : 1},{ pic : require("my-icons/img/menu_03.png"), index : 2},{ pic : require("my-icons/img/menu_04.png"), index : 3},{ pic : require("my-icons/img/menu_05.png"), index : 4},{ pic : require("my-icons/img/menu_06.png"), index : 5},{ pic : require("my-icons/img/menu_07.png"), index : 6},{ pic : require("my-icons/img/menu_08.png"), index : 7}];
// ...
renderItem(v) {
    return (
            <TouchableOpacity
                onPress={onTouchItem.bind(v.item.index)}
            >
                <Image 
                    source={v.item.pic} 
                    style={styles.menuitem_pic}
                    resizeMode="contain"
                />
            </TouchableOpacity>
    )
}

I've checked the android/src/main/res/drawable-mdpi/ folder and they get copied there correctly.

The only symptom I see in logcat is this:

01-16 16:15:18.298 13322-13816/? W/unknown:ProgressiveDecoder: unknown image format, {uri: res:/2131231024, firstEncodedBytes: 3C3F786D6C2076657273, length: 6953}
01-16 16:15:18.306 13322-13823/? W/unknown:ProgressiveDecoder: unknown image format, {uri: res:/2131231033, firstEncodedBytes: 3C3F786D6C2076657273, length: 2567}
01-16 16:15:18.313 13322-13823/? W/unknown:ProgressiveDecoder: unknown image format, {uri: res:/2131231032, firstEncodedBytes: 3C3F786D6C2076657273, length: 2808}
01-16 16:15:18.317 13322-13616/? W/unknown:ProgressiveDecoder: unknown image format, {uri: res:/2131231033, firstEncodedBytes: 3C3F786D6C2076657273, length: 2567}

corresponding to the 4 Images that do not get rendered.

Reproducible Demo

n/a (reproduccible on android release only)

@dulmandakh
Copy link
Contributor

Hello there 👋 by using the repro / the list of steps to reproduce, we can't actually see the reported bug on RN 0.59 so we'll close this issue. It may have something to do with your local setup, please double check that you are using the correct version of Android Studio / XCode / Android NDK / Yarn / etc.

@dulmandakh
Copy link
Contributor

could you please check if your images files are not corrupted, and in good format.

@yasahmed
Copy link

yasahmed commented May 6, 2019

i have the same issue !!

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: Image Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants