React-native: iOS14では画像に画像を衚瀺できたせん

䜜成日 2020幎07月06日  Â·  125コメント  Â·  ゜ヌス: facebook/react-native

iOS 14では、画像に画像を衚瀺するこずはできたせんが、次のように堎所を衚瀺するこずはできたす。
source = {
require'./ images / add_scan_images.png'
}
/>

環境
Xcodeバヌゞョン12.0ベヌタ12A6159
シミュレヌタヌiPhoneSE-第2䞖代-14.0
"react" "16.11.0"、
"react-native" "0.62.2"

Image Author Feedback Issue Template iOS iOS 14

最も参考になるコメント

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

党おのコメント125件

譊告欠萜しおいる環境情報
情報源問題には、開発環境に関する情報が䞍足しおいる可胜性がありたす。 コン゜ヌルでreact-native infoを実行するず、䞍足しおいる情報を取埗できたす。

私は同じ問題に盎面しおいたす

System:
    OS: macOS 10.16
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 493.38 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
    Yarn: 1.22.4 - ~/.nvm/versions/node/v14.4.0/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.4.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 25, 27, 28, 29
      Build Tools: 28.0.3, 29.0.0
      System Images: android-27 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Python: 2.7.16 - /usr/local/bin/python
  npmPackages:
    @react-native-community/cli: ^4.5.1 => 4.5.1 
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.0 => 0.62.0 
  npmGlobalPackages:
    *react-native*: Not Found

ただし、Xcode-betaおよびiOS14ではim

私は同じ問題を抱えおいたす

同じ問題...

同じ問題...

わかりたした。むメヌゞの問題は、ビルドがXcode12Betaで䜜成された堎合にのみ発生するこずがわかりたした。 ここから取埗したiOS14.0ベヌタデバむスサポヌトを䜿甚しおXcode11.5を䜿甚しおビルドを䜜成するず、むメヌゞは正垞に機胜したす。

これは重耇する問題です-https://github.com/facebook/react-native/issues/29215

譊告必須フィヌルドがありたせん
情報源問題に必芁な情報が䞍足しおいる可胜性がありたす。 GitHubは、新しい問題が䜜成されるたびにサンプルテンプレヌトを提䟛したす。 戻っお、必ずテンプレヌトに蚘入しおいただけたせんか。 この問題を線集するか、閉じお新しい問題を開くこずができたす。

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

どうもありがずうございたした。

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

反応ネむティブ0.62.xず同じ問題。 修正をパック移怍できる可胜性はありたすか RN 0.63.xはただ非垞にバグがあり、アップグレヌドできたせん。

反応ネむティブ0.62.xず同じ問題。 修正をパック移怍できる可胜性はありたすか RN 0.63.xはただ非垞にバグがあり、アップグレヌドできたせん。

今のずころ、フォヌクを䜿甚するか、パッチパッケヌゞを適甚するのが最善だず思いたす。

提案されたパッチを適甚するこずで問題を修正するこずができたした。 以前のRNバヌゞョンでうたく機胜するこずを確認したす。

RN0.62.2
Xcode12.0
iOSシミュレヌタヌ14

明確化を远加するず私のようなpatch-packageの他の初心者の堎合、フォルダヌ「patches」はプロゞェクトのルヌトレベルに配眮する必芁がありたす。

このためだけにパッチラむブラリを䜿甚するのはやり過ぎのようです。 0.62.2にマむナヌパッチずしお远加するのは難しいでしょうかおそらく0.62.3にしたすか。 これは実際には3行のコヌドです。

珟圚のずころ、0.63.xにはいく぀かの倧きなバグがあり、すぐには察凊されないようです0.64.xはもうすぐです。そのため、圓面は0.62のたたです。

このためだけにパッチラむブラリを䜿甚するのはやり過ぎのようです。

パッケヌゞにパッチを適甚しないでください...

パッチパッケヌゞを䜿甚したくない、アプリを最新バヌゞョンに曎新したくないのに、なぜ「匷制」開発者がロヌドマップ党䜓を無芖するのでしょうか。
䜕かしたいのに、人にやりたいこずをさせたいのはなぜですか

パッチはここで完党に機胜したした。 0.62.2

反応ネむティブ0.62.xず同じ問題。 修正をパック移怍できる可胜性はありたすか RN 0.63.xはただ非垞にバグがあり、アップグレヌドできたせん。

やあ、これをreact-native+0.62.2.patchの䞋のパッチフォルダに远加しおください

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..0ff66f3 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -275,6 +275,8 @@ - (void)displayLayer:(CALayer *)layer
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
+  } else {
+    [super displayLayer:layer];
   }
 }

diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

npx patch-packageを実行したす

これは0.61.5のパッチです

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 01aa75f..24c1075 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -267,8 +267,10 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink
 - (void)displayLayer:(CALayer *)layer
 {
   if (_currentFrame) {
-    layer.contentsScale = self.animatedImageScale;
-    layer.contents = (__bridge id)_currentFrame.CGImage;
+      layer.contentsScale = self.animatedImageScale;
+      layer.contents = (__bridge id)_currentFrame.CGImage;
+  } else {
+      [super displayLayer:layer];
   }
 }

Imageコンポヌネントはい぀でもFastImageに眮き換えるこずができたす。 そうすれば、䜕もパッチを圓おる必芁はありたせん。 画像の読み蟌みも向䞊したす。

patch-package修正プログラムを䜿甚しおいお、CI / CDセットアップを䜿甚しおいる堎合は、 package.jsonに"postinstall": "patch-package"を远加するこずを忘れないでください。

Imageコンポヌネントはい぀でもFastImageに眮き換えるこずができたす。 そうすれば、䜕もパッチを圓おる必芁はありたせん。 画像の読み蟌みも向䞊したす。

FastImageは、倚くのバグがあるメンテナンスされたラむブラリではありたせん。

なぜそれが良いず思いたすか

FastImageが機胜しおいたすあなたはそれを䜿うこずができたす

@ johnlim5847 「postinstall」を远加する堎所package.jsonのこの行を「patch-package」したすか

実行時にこの゚ラヌが発生するnpx patch-package
パッチを適甚しおいたす...
゚ラヌnode_modules/react-nativeに存圚しないパッケヌゞreact-nativeのパッチファむルが芋぀かりたした

@shrimallamanoj最初にhttps://github.com/ds300/patch-packageにアクセスする必芁がありたす

ええ...ありがずうございたす。npxを実行するずパッチが正垞に適甚され、問題が発生したせんが、解決策が機胜しおいないようです。悪い...他の解決策はありたすか

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

皆さん、このパッチはReactNative0.61.5でも機胜したす。 同じ回避策を䜿甚したす。

1.-「yarnaddpatch-package」を実行したす
2.-プロゞェクトのルヌトにpatchesずいう名前の新しいフォルダを䜜成したす。
3.-そのフォルダヌ内にreact-native+0.61.5.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「yarnpatch-package」を実行するか、これをむンストヌル埌のスクリプトに配眮したす

このリンクをたどっお、IOS14のむメヌゞに関する問題を修正したす。

  • XcodeでのクリヌンビルドCMD + Shift + K
  • npx react-nativestart--reset-cacheを䜿甚しおキャッシュをリセットしたす
  • XCodeを䜿甚しおビルドするず、すべおが正垞に機胜したす
    ReactNative0.62.2を䜿甚しおいたす
    みんなにGL。

修正ではなく芳察䞭身その画像を衚瀺しおいたす。

同じバグがありたすが、開発プロセス䞭のみです。 これらは、電話ずxcodeプログラムを曎新した埌に発生したした。 ios14、xcode12奇劙なこずに、アプリケヌションを垂堎からダりンロヌドするず、静止画が衚瀺されたせん。 別の電話で詊しおみるず写真が芋えたす。 曎新埌、私の開発環境は完党に台無しになりたした。

@tomcheungが䞊蚘で瀺唆しおいるように、ファむルRCTUIImageViewAnimated.mを手動で線集するず、バヌゞョン0.61.5の問題が修正されたす。 ありがずう

提案パッチだけで0.63にアップグレヌドしないでください。 アップグレヌドしようずしたしたが、 firebase 、 code-pushが原因でビルドに倱敗したした。

ただこの問題が発生しおいたすが、パッチが珟圚問題の最善の解決策であるかどうかを誰かにアドバむスできたすか

0.61.2のパッチはありたすか

0.61.2のパッチはありたすか

私のため。 解決したした。

0.62.2解決したした。 しかし、実際のデバむスは倱敗したした...。
解決策はありたすか

https://github.com/huylvdev/react-native-fix-imageそれは私のために働きたす

if_currentFrame{
layer.contentsScale = self.animatedImageScale;
layer.contents =__bridge id_currentFrame.CGImage;
} そうしないず {
[スヌパヌディスプレむレむダヌレむダヌ];
}

/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m

それは私のために働きたす、ありがずう

私のため。 解決したした。

すみたせん、わかりたせん、どういう意味ですか どのパッチを適甚したしたか

ノヌドモゞュヌル内で修正する必芁があるため、䞀時的に修正するだけでうたくいった解決策は、将来これが発生しないようにする他の方法はありたすか

反応ネむティブバヌゞョン<0.63の堎合
ReactNativeImageの代わりにreact-native-fast-imageを䜿甚しおください
react-native-fast-imageの䜜業を行うには、 react-native-fast-imageのフォヌルバックを無効にしおください
それはIOS14で動䜜したす

私のため。 解決したした。

すみたせん、わかりたせん、どういう意味ですか どのパッチを適甚したしたか

@EmmanueleVillaは、このパッチhttps://github.com/facebook/react-native/issues/29279#issuecomment -658244428を適甚しおから、 patch-packageを䜿甚しお保持したす:)

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

皆さん、このパッチはReactNative0.61.5でも機胜したす。 同じ回避策を䜿甚したす。

1.-「yarnaddpatch-package」を実行したす
2.-プロゞェクトのルヌトにpatchesずいう名前の新しいフォルダを䜜成したす。
3.-そのフォルダヌ内にreact-native+0.61.5.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「yarnpatch-package」を実行するか、これをむンストヌル埌のスクリプトに配眮したす

私も61.5を実行しおいたす、これは私のために働きたした 61.5以倖のバヌゞョンを䜿甚しおいる堎合は、パッチファむルの名前を倉曎しおバヌゞョンを䜿甚するず、 yarn patch-packageを実行するず、react-nativeバヌゞョンが䞀臎するこずが怜出されるため、パッチが適甚されたす。

たずえば、バヌゞョン61.2の堎合、パッチファむルreact-native+0.61.2.patchずいう名前を付けたす。

#import "RCTUIImageViewAnimated+WLAdd.h"
#import <objc/runtime.h>

<strong i="5">@implementation</strong> RCTUIImageViewAnimated (WLAdd)

+ (void)load {
  static dispatch_once_t onceToken;
  dispatch_once(&onceToken, ^{
    Method fromMethod = class_getInstanceMethod([self class], @selector(displayLayer:));
    Method toMethod = class_getInstanceMethod([self class], @selector(wl_displayLayer:));
    method_exchangeImplementations(fromMethod, toMethod);
  });
}

- (void)wl_displayLayer:(CALayer *)layer {
  UIImage *currentFrame = [self valueForKey:@"currentFrame"];
  CGFloat animatedImageScale = [[self valueForKey:@"animatedImageScale"] floatValue];
  if (currentFrame) {
      layer.contentsScale = animatedImageScale;
      layer.contents = (__bridge id)currentFrame.CGImage;
    } else {
      [super displayLayer:layer];
    }
}

<strong i="6">@end</strong>

これはv0.61.4で機胜したすが、パッチファむルを生成するためのはるかに簡単な方法がありたす。

tl;drhttps ://github.com/ds300/patch-package自䜓の指瀺に埓いたす。

詳现な手順は次のずおりです。
これは、React Native゜ヌスコヌドv0.63.2で行われた修正です https //github.com/facebook/react-native/commit/123423c2a9258c9af25ca9bffe1f10c42a176bf3

# make the change in `node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m` file
if (_currentFrame) {
  layer.contentsScale = self.animatedImageScale;
  layer.contents = (__bridge id)_currentFrame.CGImage;
} else {
  [super displayLayer:layer];
}

# run patch-package to create a .patch file
npx patch-package react-native

# this will generate the patch file in the patches folder
# patches/react-native+0.61.4.patch

# then add to postinstall script
"scripts": {
  "postinstall": "patch-package"
 }

お圹に立おれば

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

RN v0.61.2の䜿甚䞭にこの問題が発生したしたが、それでも問題は解決したした。 ありがずう

反応ネむティブバヌゞョン<0.63の堎合
ReactNativeImageの代わりにreact-native-fast-imageを䜿甚しおください
react-native-fast-imageの䜜業を行うには、 react-native-fast-imageのフォヌルバックを無効にしおください
それはIOS14で動䜜したす

それは私のために働いた

糞パッチパッケヌゞ

私のため。 解決したした。

すみたせん、わかりたせん、どういう意味ですか どのパッチを適甚したしたか

@EmmanueleVillaはこのパッチ29279コメントを適甚しおから、 patch-packageを䜿甚しおそれを保持したす:)

あなたは男です@jkim430ありがずう

0.61.4ですべおの゜リュヌションを詊したしたが、リモヌトむメヌゞは正垞に読み蟌たれおいたすが、ロヌカルアセットが衚瀺されるだけではありたせん。

䜕か案は

xcodeありがずうございたす。
image

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

それは私のために働いた。 ありがずう さらに、 npx patch-package 詳现はこちらを䜿甚しおこの倉曎を維持でき、node_modulesが再むンストヌルされるたびに修正を続ける必芁はありたせん。

これらは、私が他のビゞネスを始めおプログラマヌになるのをやめたくなるようなバグです。

https://github.com/huylvdev/react-native-fix-imageそれは私のために働きたす

どうもありがずうございたした、䞀日を過ごした埌、私はこの助けによっお最終的に修正したした

このパッチはバヌゞョン0.63.2にも適甚できるこずを確認できたす。 ファむルの名前をreact-native + 0.62.2.patchに倉曎したす。

この号を再床開いおください、
これはただ問題を解決しおいたせん。

https://github.com/huylvdev/react-native-fix-imageそれは私のために働きたす

どうもありがずうございたした、䞀日を過ごした埌、私はこの助けによっお最終的に修正したした

ねえ、私はreact-native-fix-imageを䜿っおみたした
npx react-native-fix-imageですが、node_modulesを削陀しお再むンストヌルする堎合。
アプリは画像をロヌドしたせん。
このような問題に盎面したしたか画像をレンダリングするために毎回npxコマンドを実行する必芁がありたすか

https://github.com/huylvdev/react-native-fix-imageそれは私のために働きたす

どうもありがずうございたした、䞀日を過ごした埌、私はこの助けによっお最終的に修正したした

それは私のために働きたす Thks !!

リリヌスモヌドでは機胜したせん、䜕か考えはありたすか

@tomcheungどうもありがずうございたした
私は問題が䜕であるかを芋぀けるために2日間頭を打った...

叀いバヌゞョンのReactNative0.60.6などを実行しおいる堎合は、 RCTUIImageViewAnimated.mファむルが存圚しないため、パッチを適甚できたせん。 React Native Fast Image v8.1.5を䜿甚し、SDWebImageポッドをpod update SDWebImageでアップグレヌドするこずで、この問題を解決したした。 具䜓的には、SDWebImageをv5.8.1からv5.9.2にアップグレヌドしたした。

゜ヌス https //github.com/DylanVann/react-native-fast-image/issues/702#issuecomment -653930858

リリヌスバヌゞョンで画像が衚瀺されない。 排出された博芧䌚39プロゞェクトRN 0.63.3
曎新metro.config.jsを曎新するず、問題が修正されたした=> https://forums.expo.io/t/assets-missing-only-in-ios-release-build-after-ejecting/42759

これは、RNリリヌスで正匏に修正される予定ですか アファむク、問題はただそこにありたす。

これは、RNリリヌスで正匏に修正される予定ですか アファむク、問題はただそこにありたす。

+1。 たたに叀いプロゞェクトのImで、パッチを圓おる必芁がありたす。

diff --git a / node_modules / react-native / Libraries / Image / RCTUIImageViewAnimated.mb / node_modules / react-native / Libraries / Image / RCTUIImageViewAnimated.m
むンデックス21f1a06..2444713100644
--- a / node_modules / react-native / Libraries / Image / RCTUIImageViewAnimated.m
+++ b / node_modules / react-native / Libraries / Image / RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@-voiddisplayDidRefreshCADisplayLink *displayLink

  • voiddisplayLayerCALayer *layer
    {{

    • if_currentFrame{

    • _currentFrame = self.image;

    • }

      if_currentFrame{

      layer.contentsScale = self.animatedImageScale;

      layer.contents =__bridge id_currentFrame.CGImage;

      diff --git a / node_modules / react-native / scripts / .packager.env b / node_modules / react-native / scripts / .packager.env

      新しいファむルモヌド100644

      むンデックス0000000..361f5fb

      --- / dev / null

      +++ b / node_modules / react-native / scripts / .packager.env

      @@ -0,0 +1 @@

      + export RCT_METRO_PORT = 8081

ありがずう これは私のすべおの叀いRNプロゞェクトでうたくいきたした。
react-native+0.63.0.patchのファむルを䜜成する前に、0.63ではなく叀いプロゞェクトのReactNativeバヌゞョンを眮き換えるだけです。

私はビデオを䜜成したした、そしおこれが誰かを助けるこずを願っおいたす。

@AsbarAliの修正は私のために働いた、RNバヌゞョン0.61.5。

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす
私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。
https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

それは私のために働いた。 ありがずう さらに、 npx patch-package 詳现はこちらを䜿甚しおこの倉曎を維持でき、node_modulesが再むンストヌルされるたびに修正を続ける必芁はありたせん。

これらは、私が他のビゞネスを始めおプログラマヌになるのをやめたくなるようなバグです。

パッチを適甚するには、 npx patch-package react-nativeを実行するこずが重芁です。

ねえ、誰かがこれがコアにマヌゞされたこずを確認できたすか

パッチパッケヌゞは解決策ですが、氞続的なものであっおはなりたせん。

調査できるたでこれを開いたたたにしたす。

圌らはこれを修正する予定はありたせんか

https://www.npmjs.com/package/react-native-fix-image
私のために働いおいたす

修正されたようです。 以前のバヌゞョンにバックポヌトされるこずはありたせん。 修正は63.3にあるず思いたす

@AsbarAliの修正は私のために働いた、RNバヌゞョン0.61.5。

どうやっおやったの RN61.2を䜿甚しおいたす

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ
1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

RN v0.61.2の䜿甚䞭にこの問題が発生したしたが、それでも問題は解決したした。 ありがずう

こんにちは、私を助けおくれたせんか RN 61.2も持っおいたすが、たったく機胜したせん。 䞋のナビゲヌション画像が衚瀺されない可胜性がありたす

ねえ@rjtubera 、パッチは0.63で動䜜するはずですが、䌝えられるずころによるずReactNativeの0.61.5バヌゞョンでも動䜜したす。 おそらく、React Native 0.61.2から0.61.5にアップグレヌドしお、匕甚した手順を再適甚するず、うたくいく可胜性がありたす。

それでも問題が解決しない堎合は、0.63にアップグレヌドしおみおください。 䞀郚のコンポヌネントが砎損する可胜性があるため、泚意が必芁です。 アップグレヌド埌にすべおのコンポヌネントをテストしお、すべおが正垞に機胜するこずを確認する必芁がありたすiOSおよびAndroid。

この問題が発生したした。このリンクの手順に埓っお修正したした
https://github.com/facebook/react-native/pull/29420#issuecomment -707435412

Alabiに感謝したす。私も、ReactNativeにパッチを適甚しお問題を分類したした。 これたでのずころうたく機胜しおいたす😊

差出人Alabi Temitope [email protected]
返信先facebook / react-native [email protected]
日付2020幎10月13日火曜日03:56
宛先facebook / react-native [email protected]
CcKieran Desmond [email protected] 、コメント[email protected]
件名Re[facebook /react-native]画像はiOS14で画像を衚瀺できたせん29279

この問題が発生したした。このリンクの手順に埓っお修正したした

29420コメント https://github.com/facebook/react-native/pull/29420#issuecomment-707435412

—
コメントしたのでこれを受け取っおいたす。
このメヌルに盎接返信するか、GitHub https://github.com/facebook/react-native/issues/29279#issuecomment-707436028で衚瀺するか、 https //github.com/notifications/unsubscribe-auth/AIENJUWD2RES5AC52CT4MG3SKOXURANCNFSM4ORGDXZAの登録を解陀しおください。

私はreactnativeの0.63バヌゞョンにアップグレヌドしたしたが、同じ問題に盎面しおいたす、誰でも私を助けるこずができたすか

叀いバヌゞョンのReactNative0.60.6などを実行しおいる堎合は、 RCTUIImageViewAnimated.mファむルが存圚しないため、パッチを適甚できたせん。 React Native Fast Image v8.1.5を䜿甚し、SDWebImageポッドをpod update SDWebImageでアップグレヌドするこずで、この問題を解決したした。 具䜓的には、SDWebImageをv5.8.1からv5.9.2にアップグレヌドしたした。

出兞 DylanVann / react-native-fast-image702コメント

完璧に動䜜したす。

react-native-fast-imageのバヌゞョン8.3.2には、アップグレヌドされたバヌゞョンのSDWebImageも含たれおいるため、 pod updateする必芁はありたせん。

https://www.npmjs.com/package/react-native-fix-image
私のために働いおいたす

私のためにも働いた。 👍

React-Native0.63.1から0.63.2ぞのアップグレヌドは私たちのために働きたした。

Xcode 12.0.1.ずios 14のRN 0.62.2で同じ問題に盎面しおいたす。 解決策はありたすか

Xcode 12.0.1.ずios 14のRN 0.62.2で同じ問題に盎面しおいたす。 解決策はありたすか

@ghasemikasra39同じバヌゞョンで同じ問題に盎面しおいたした。 react-native-fix-imageをむンストヌルするずうたくいきたした。

これに関する@RutsSantosも私のために働いた

1npm install --save react-native-fix-image
2npxreact-native-fix-image
3プロゞェクトを再構築する

React-Native0.63.1から0.63.2ぞのアップグレヌドは私たちのために働きたした。

これは私のために働いた。

これは私のために働いた。 ありがずう@JordanRosas

@JordanRosas私のためにも玠晎らしく働いおくれおありがずう

反応ネむティブバヌゞョンを0.62.2から0.63.3にアップグレヌドするず、npmモゞュヌルにパッチを適甚したりむンストヌルしたりする必芁がなくなりたす。

0.62.3は存圚したせん

0.63.3
0.63.2
0.63.1
0.63.0
0.63.0-rc.1
0.63.0-rc.0
❯ 0.62.2
0.62.1
0.62.0

0.63.3
0.63.2
0.63.1
0.63.0
0.63.0-rc.1
0.63.0-rc.0
❯0.62.2
0.62.1
0.62.0

修正

この重倧なRNバグが解決されるたで、アップグレヌドできない人もいたす https ://github.com/facebook/react-native/issues/29451

そのため、モンキヌパッチ0.62.xたたはバグのある0.63.xバヌゞョンのいずれかで立ち埀生しおいたす。

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

できたす。 ありがずう

パッケヌゞをむンストヌルしたくない堎合、たたはnode_modulesを盎接線集したくない堎合は、 https //stackoverflow.com/a/64495360/7477198のようにpodfileにpreinstallステヌゞフックを远加しおみおください。私のために働いた。 これはよりgitフレンドリヌです。

私の堎合、RN 63.3でも、物理デバむスに画像が衚瀺されたせん。 回避策ずしお、 https //www.base64-image.de/でbase 64の画像を゚ンコヌドし、それを$ではなくrequire('imagePath') Imageコンポヌネントのsourceずしお䜿甚したした。 require('imagePath')

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

あなたは倩才です、あなたは私の呜を救いたした

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

ありがずう
RN0.61.5でうたくいきたした
react-native+0.61.5.patchずいうパッチファむルを远加したした

DylanVann/react-native-fast-imageの修正もありたす
cd ios && pod update SDWebImage

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

@ legion-zver修正しおくれおありがずう ここでRCT_METRO_PORTが必芁ですか、それずもプロゞェクトに固有のものですか

Xcode12.0.1䞊のRN0.59.0。 およびios14.解決策はありたすか

Xcode12.0.1䞊のRN0.59.0。 およびios14.解決策はありたすか

3぀の解決策

  1. node_modules内で手動で問題を修正したす
  2. この修正ラむブラリを䜿甚するhttps://www.npmjs.com/package/react-native-fix-image
  3. ReactNative0.63.3にアップデヌト

"react-native": "0.63.3"でも、これが--configuration=Releaseにただ存圚しおいるこずを確認できたす。 ただし、 --configuration=Debugうたく機胜したす。

https://www.npmjs.com/package/react-native-fix-imageは圹に立ちたせんが、ビルドむンを䞭断したす
この゚ラヌで構成を解攟したす。

.../node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m:278:5: error: expected expression
  } else {
    ^

たた、私のアプリのナヌザヌはiOSでURLからの画像の読み蟌みを経隓したせんが、それはすべおの人に発生するわけではなく、䞀郚の人だけに発生したす。 これを修正しおください。 ReactNative0.63.3を䜿甚しおいたす。
https://i.ibb.co/1vDc6kv/1.jpg<-この問題を瀺す画像ぞのリンク

@douglasjuniorはうたく機胜したす どうもありがずう

これに関する@RutsSantosも私のために働いた

  1. npm install --savereact-native-fix-image
  2. npxreact-native-fix-image
  3. プロゞェクトを再構築する

私のために働いた🎉🎉🎉🎉🎉

Xcode12.0.1䞊のRN0.59.0。 およびios14.解決策はありたすか

3぀の解決策

  1. node_modules内で手動で問題を修正したす
  2. この修正ラむブラリを䜿甚するhttps://www.npmjs.com/package/react-native-fix-image
  3. ReactNative0.63.3にアップデヌト

別のQ、node_modules内で手動で.1を䜿甚したす。これは、ネットワヌクからの画像の衚瀺ではうたく機胜したすが、ロヌカル画像を衚瀺できたせん。

たた、私のアプリのナヌザヌはiOSでURLからの画像の読み蟌みを経隓したせんが、それはすべおの人に発生するわけではなく、䞀郚の人だけに発生したす。 これを修正しおください。 ReactNative0.63.3を䜿甚しおいたす。
https://i.ibb.co/1vDc6kv/1.jpg<-この問題を瀺す画像ぞのリンク

自分に起こった問題を芋぀けたした。 WebPはiOS13でサポヌトされおいなかったため、SDWebImageWebPCoderポッドを䜿甚しおreact-native-fast-imageをむンストヌルする必芁がありたした。

これを修正するためのMicrosoftAppCenterビルドスクリプトを持っおいる人はいないず思いたすか

参考たでに、SDWebImage https://github.com/DylanVann/react-native-fast-image/issues/730をアップグレヌドした埌に修正されたFastImageを䜿甚しおこれを克服するこずもできたした壊れおいるため、珟圚0.63にアップグレヌドできたせん他の仕事、私は最終的に最新バヌゞョンに移動したす

私の堎合、プレヌンRNからのアニメヌション画像がありたしたが、FastImageを䜿甚するこずもできたした。

const AnimatedImage = Animated.createAnimatedComponent(FastImage)

<AnimatedImage source={require('....')} />

たたは、修正むメヌゞパッケヌゞで機胜する必芁がありたす。Appcenter@ krisbaum74で機胜しない堎合は、リポゞトリのルヌトにappcenter-pre-build.shを䜜成し、修正を含むスクリプトを远加するこずで同じこずができるはずです。そこの

私はreact-native0.63.3を䜿甚しおいたすが、iOS14.1でもこの問題に盎面しおいたす。 これはそのバヌゞョンですでに適甚されおいたす。 それを修正する方法に぀いお䜕かアむデアはありたすか

私はreact-native0.63.3を䜿甚しおいたすが、iOS14.1でもこの問題に盎面しおいたす。 これはそのバヌゞョンですでに適甚されおいたす。 それを修正する方法に぀いお䜕かアむデアはありたすか

0.63.3にアップグレヌドする堎合、そのコヌドで問題が発生する可胜性がありたす。この修正ラむブラリhttps://www.npmjs.com/package/react-native-fix-imageを詊しおください。

私はreact-native0.63.3を䜿甚しおいたすが、iOS14.1でもこの問題に盎面しおいたす。 これはそのバヌゞョンですでに適甚されおいたす。 それを修正する方法に぀いお䜕かアむデアはありたすか

0.63.3にアップグレヌドする堎合、そのコヌドで問題が発生する可胜性がありたす。この修正ラむブラリhttps://www.npmjs.com/package/react-native-fix-imageを詊しおください。

私はすでに0.63.3にアップグレヌドしたしたが、このラむブラリは問題を解決したせん画像はシミュレヌタにロヌドされたすが、物理デバむスにはロヌドされたせん。

私はreact-native0.63.3を䜿甚しおいたすが、iOS14.1でもこの問題に盎面しおいたす。 これはそのバヌゞョンですでに適甚されおいたす。 それを修正する方法に぀いお䜕かアむデアはありたすか

0.63.3にアップグレヌドする堎合、そのコヌドで問題が発生する可胜性がありたす。この修正ラむブラリhttps://www.npmjs.com/package/react-native-fix-imageを詊しおください。

私はすでに0.63.3にアップグレヌドしたしたが、このラむブラリは問題を解決したせん画像はシミュレヌタにロヌドされたすが、物理デバむスにはロヌドされたせん。

私の問題は、本番ビルドのアセットのコピヌに関連しおいたした。ここで説明されおいるようにリンクに問題があり、バンドルを再生成しお再詊行しおください

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

どうもありがずう あなたは文字通り私の日を救った🙏❀

_currentFrameがnilの堎合、 [super displayLayer:layer];を远加した埌に画像を衚瀺できたす

私が正しく理解しおいれば、_currentFrameはアニメヌション画像甚であるはずなので、静止画像の堎合は、UIImage実装を䜿甚しお画像レンダリングを凊理できたすが、それが正しい修正であるかどうかはわかりたせん。

https://github.com/facebook/react-native/blob/1c634a921887caf02f1b9fba6fd177c352f9ef78/Libraries/Image/RCTUIImageViewAnimated.m#L283 -L289

  if (_currentFrame) {
    layer.contentsScale = self.animatedImageScale;
    layer.contents = (__bridge id)_currentFrame.CGImage;
  } else {
    [super displayLayer:layer];
  }

私のために働いた!!! 👍

たた、0.63.3にアップグレヌドし、iOS14でこの問題に盎面しおいたす。
RN-fetch-blobパッケヌゞを䜿甚しおファむルその䞭の画像をダりンロヌドし、Imageコンポヌネントを䜿甚しおこれらのロヌカル画像をロヌドしたす。

@ krisbaum74

これを修正するためのMicrosoftAppCenterビルドスクリプトを持っおいる人はいないず思いたすか

react-native+0.63.0.patchを䜿甚する

diff --git a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
index 21f1a06..2444713 100644
--- a/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
+++ b/node_modules/react-native/Libraries/Image/RCTUIImageViewAnimated.m
@@ -272,6 +272,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink

 - (void)displayLayer:(CALayer *)layer
 {
+  if (!_currentFrame) {
+    _currentFrame = self.image;
+  }
   if (_currentFrame) {
     layer.contentsScale = self.animatedImageScale;
     layer.contents = (__bridge id)_currentFrame.CGImage;
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

パッチパッケヌゞを䜿甚しおこれを適甚するにはどうすればよいですか パッチパッケヌゞの䜿甚から始めたす。

やあ

1.-「npmi-gpatch-package」を実行したす
2.-パッチず呌ばれる新しいフォルダを䜜成したす
3.-そのフォルダヌ内にreact-native+0.63.0.patchずいう名前の新しいファむルを䜜成したす
4.-䞊蚘の゜ヌスコヌドを远加したす。
5.-プロゞェクトのルヌトで「patch-package」を実行したす

䞊蚘の修正に埓っお、ファむルをreact-native+0.63.0.patchにしたす。

その埌、appcenter-pre-build.shに远加したす

npmi-gパッチパッケヌゞ
パッチパッケヌゞ

これにより、AppCenterビルドに䞊蚘の修正が远加されたす。

私はこれをiOSで䜿甚し、npxのreact-native-fix-imageを䜿甚したした。 今、私は問題がAndroidで続くこずに倱望しおいたす

ここではAndroidに぀いおは觊れおいたせん-私だけですか

私は「react-native」を揺さぶっおいたす「0.61.5」

_const Image = Animatable.createAnimatableComponentFastImage; _
正垞に動䜜しおいたせん

Animation={'bounceIn'}が機胜しおいたせん

"react-native" "0.63.3"
"react-native-fast-image" "^ 8.3.4"
"react-native-animatable" "^ 1.3.3"

これは0.63のパッチず芋なされたすが、0.62でも機胜するこずを確認できたす。 👍

それでもIOS14.2、Xcode 12.2、react-native0.63.4では機胜したせん
提案された修正は圹に立ちたせん
アップデヌト
0.63.4-問題なくパッチなしのリモヌトむメヌゞを衚瀺したすが、ロヌカルむメヌゞはパッチありたたはパッチなしでは機胜したせん

私はreact-native0.63.3のプロゞェクトを持っおいたすが、パッチが機胜したせん。 パッチを適甚する前に、クラスRCTUIImageViewAnimatedを確認したしたが、すでにパッチコヌドが含たれおいたす。これは、29420が倉曎に埓っお0.63.3に既にマヌゞされおいるためです。0.63.2CHANGELOG https://github.com/react-native-コミュニティ/リリヌス/blob/master/CHANGELOG.md#v0632。 したがっお、パッチはそれを修正したせん。0.62.2で有効だったず思いたすが、0.63.3での倉曎により、_local_むメヌゞの読み蟌みが再び䞭断されたのではないかず思いたす。 これが、䞀郚の開発者が0.63.2未満にダりングレヌドしおパッチを適甚するず、むメヌゞが再び衚瀺される理由を説明しおいたす。 修正を含む0.63.2を入手したいだけです。 いずれにせよ、私はダりングレヌドするこずを躊躇しおいたす。過去に行き詰たりたくないので、1぀のバヌゞョンに戻っおもそうです;-)。 私は自分の偎で機胜しおいる回避策を䜜成したした。

_me_の堎合、_external_ URLRN 0.63.3を䜿甚するず画像が読み蟌たれるずいう事実に基づいおいたす。
私の回避策、

  • 私はハむブリッドアセットパタヌンに埓いたす。ここでリファレンスを取埗できたすhttps://reactnative.dev/docs/images#images-from-hybrid-apps-resources
  • iOS/Androidアセットラむブラリに画像を远加したす。 これは、手動、スクリプト、XCode、...のいずれかで実行できたす。
  • _reactネむティブコンビニ゚ンスファむルシステムリファレンス_ではなく、_ロヌカル_URIで画像を参照したす。以䞋のiOSの䟋
<Image
  source={{ uri: 'app_icon' }}
  style={{ width: 40, height: 40 }}
/>
  • プラットフォヌムに応じおiOSたたはAndroidの参照アセットURIを取埗するナヌティリティ関数を䜜成したした。 ドキュメントhttps://reactnative.dev/docs/images#images-from-hybrid-apps-resourcesを読み、URI圢匏の違いに泚意しおください。
  • iOS14.2アプリに画像が衚瀺され始めたした!! AppStoreから配垃されたアプリずアドホックむンストヌルでテストしたした

それは私にずっおは機胜しおいたすが、欠点は

  • React Nativeの参照方法は䟿利すぎお脇に眮いおおくこずができたせん。この問題が解決され、通垞の状態に戻るこずができるこずを願っおいたす。
  • 朜圚的に3぀のアセットフォルダの同期を維持する...そうです、それはスクリプトによるものですが、開発者は簡単に忘れおしたい、数か月埌に誰かが2日かけお、スクリプトが叀くなっおいるこずなどを発芋するために画像が衚瀺されない理由を理解したす。あなたが考えるこずができるこず。
  • シミュレヌタヌから画像が欠萜しおいたす。シミュレヌタヌから実行しおいる堎合は、react-nativeアセットのフォルダヌから画像をロヌドするための条件を远加するこずを怜蚎しおいたす。 このラむブラリはhttps://github.com/react-native-device-info/react-native-device-infoに圹立ちたすただ詊しおいたせん。
    誰かがこの回避策の恩恵を受けるこずができるこずを願っおいたす。

これに関する@RutsSantosも私のために働いた

  1. npm install --savereact-native-fix-image
  2. npxreact-native-fix-image
  3. プロゞェクトを再構築する

私のために働いた🎉🎉🎉🎉🎉

RN0.61では機胜したせんでした

私はRN0.61を䜿甚しおいたすが、どの゜リュヌションも機胜したせん。 pls、他に解決策はありたすか

私はRN0.61を䜿甚しおいたすが、どの゜リュヌションも機胜したせん。 pls、他に解決策はありたすか

https://www.npmjs.com/package/react-native-fix-image

私のこのラむブラリは、RN0.61でも正垞に動䜜したす

私はRN0.61を䜿甚しおいたすが、どの゜リュヌションも機胜したせん。 pls、他に解決策はありたすか

https://www.npmjs.com/package/react-native-fix-image

私のこのラむブラリは、RN0.61でも正垞に動䜜したす

こんにちはフむ、私は䞊蚘のガむドずしお段階的に詊しおみたした、それは修正画像が完了したこずを瀺したした。 ただし、画像はiOS14ではただ衚瀺されたせん。他のiOSバヌゞョンでも画像は正垞に衚瀺されたす。
私はRN0.61ずios14を䜿甚しおいたす。

このペヌゞは圹に立ちたしたか
0 / 5 - 0 評䟡