microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

[Android] <Image> prop defaultSource doesn't work after CodePush #1726

Closed brooklyn097 closed 4 years ago

brooklyn097 commented 4 years ago

Steps to Reproduce

  1. Build a release APK and install it
  2. Open and check the default image of an <Image> is showing correctly while loading the actual image.
  3. Change something with the source code and run command appcenter codepush release-react -a ownerName/AppName -d Production
  4. Restart app to apply update.
  5. default image of an <Image> component will not show as it was.

Expected Behavior

default image show as before receiving an update through CodePush

Actual Behavior

default image does not show

Environment

Example code:

<Image source={{uri: this.props.data.thumbnail}} style={styles.container} defaultSource={require('../assets/images/thumb_default.png')} />

andreidubov commented 4 years ago

Hi @brooklyn097 , Thank you for reporting!

As I can see, you are using react-native v0.60.5 and react-native-code-push v5.7.0 but these are incompatible versions, you can take a look at supporting CodePush versions here: https://github.com/microsoft/react-native-code-push#supported-react-native-platforms

Not so long ago we released a new version of Code Push which supports react-native v0.60-v0.61. All steps for installing the latest version of the plugin are described in our documentation. iOS: https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-ios.md Android: https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md

If you still have this issue, could you please provide more detailed reprosteps or test project with reproducing issue?

I'm going to close this issue for now. Please feel free to reopen it if you have any questions or issues.

harshit-prog commented 4 years ago

Please re-open the issue, I am getting the same error.

React Native Version - 0.61.5
 Code push version - ^6.3.0

I am using local image as defaultSource which is working fine for the release new build but after pushing any changes through code push. It stops working.

This command I am using to push my changes

appcenter codepush release-react -a / --disable-duplicate-release-error -d Production

raghvendrapacholi commented 3 years ago

Hi @andreidubov ,

I am also facing same issue in android only for React native version : 0.62.2 and CodePush version: ^6.4.0.

I am using local image as defaultSource which is working fine for the release new build but after pushing any changes through code push. It stops working and I am getting blank space in place of image.

I am using this command for releasing codepush update:

appcenter codepush release-react -a OwnerName/AppName -d DeploymentTarget

fauzymk commented 3 years ago

Hi i'm still getting the same issue. Is there any solution?

Currently using React Native 0.63.4 and CodePush 6.4.0

syxxjgh commented 3 years ago

In android can not resolve local image assets after update label v2 label v1 is ok currently using React Native 0.64.2 and CodePush 7.0.2

wragony commented 3 years ago

In android can not resolve local image assets after update label v2 label v1 is ok currently using React Native 0.64.2 and CodePush 7.0.2

i'm still getting the same issue

FarNorth11 commented 2 years ago

I solved the problem After codepush is updated, app will read the updated resource file address Unfortunately, the default attribute of the image component can only read the previous resource file

Modify image android. JS, let default read local resources, which can be solved

FarNorth11 commented 2 years ago

在android中更新标签v2标签v1后无法解析本地图像资产当前使用React Native 0.64.2和CodePush 7.0.2

我仍然遇到同样的问题

node_modules/react-native/Libraries/Image/resolveAssetSource.js resolver.resourceIdentifierWithoutScale() resourceIdentifierWithoutScale() can get the local path of picture resources.

lnwanghao commented 2 years ago

在android中更新标签v2标签v1后无法解析本地图像资产当前使用React Native 0.64.2和CodePush 7.0.2

我仍然遇到同样的问题

node_modules/react-native/Libraries/Image/resolveAssetSource.js resolver.resourceIdentifierWithoutScale() resourceIdentifierWithoutScale() can get the local path of picture resources.

Sorry, i don‘t know how to use resolver.resourceIdentifierWithoutScale(), is there any example to solve it?

december1990 commented 9 months ago

The same issue with react-native: 0.64.4 and code-push:7.0.5 , it's strange that images with source prop show the images but images with defaultSource don't, they both have static file paths.