Closed kkgelu closed 8 years ago
@kkgelu, is it always that one image that is problematic? Does this happen consistently, or do images disappear at random?
Do you think this issue could be related? https://github.com/facebook/react-native/issues/5568
Hmm... I just realised I should have filled this one to https://github.com/Microsoft/react-native-code-push
Yes, it happened twice:
It's totally possible something else is wrong. Those images are markers on the (buggy) https://github.com/lelandrichardson/react-native-maps component.
I am willing to wait a little to try later with latest code-push command tool and react native plugin. For now I stop code pushing on Android.
@kkgelu Just to confirm: the only images that disappear are markers on the map component, and they disappear every time you release a CodePush update (as opposed to only randomly)? If so, that sounds like an incompatibility between the maps component and CodePush. We maintain a list of supported components precisely because we recognize that not every component which allows you to reference image assets will automatically work with CodePush. We can test out the maps component today and see what the issue might be and possibly we can send a PR to it to fix it.
In the future, I would recommend testing the CodePush update experience locally using a non-production deployment key. That way, you can verify that it supports all of your requirements instead of needing to be surprised in production. We're working hard to address all of these interop issues, but we haven't been able to resolve them all yet.
@lostintangent thank you for suggestions!
Yes. I have 3 of 4 markers consistently disappear every time I release a new CodePush update. I'll plan some time next week to see if I can repro without React Native maps.
@kkgelu, I investigated this and reproduced the behavior with react-native@0.22.2, react-native-maps@0.3.1 and react-native-code-push@ 1.10.0-beta.
The issue is that assets loaded from a CodePush update are referenced with a file:// URI, but react-native-maps doesn't support file:// URI's. A simple fix this would be add || uri.startsWith("file://")
as a condition in this line.
@kkgelu, the change has been merged into lelandrichardson/react-native-maps.
On android:
My code-push command tool version is 1.9.1-beta; My react-native app has the version of "react-native-code-push": "^1.8.0-beta" in package.json.
An example of the image:
Path in my React native app: myapp/image/map/marker4_jp.png (140 × 180)
Code to show the image:
I can see in the generated bundle (for upload), it's located in:
myapp/release/drawable-mdpi/image_map_marker4_jp.png
Please notice that the name _image_map_marker4jp.png is different than the original file name, but I guess that's by design? Even more strange, I can see in the same myapp/release/drawable-mdpi/ folder, most of the other images do load in the newer version after restart. So it doesnot happen to every image.
I' ll see if I can provide more information, it's just hard for me to debug...