Skip to content

Commit

Permalink
crash reproduction after pull:
Browse files Browse the repository at this point in the history
software-mansion/react-native-screens#1406

● App will not crash if there is single blurview
● In first screen there is 1 blurview and the app did not crash
● In second screen there are multiple blurview and app crashed with exception `java.lang.IndexOutOfBoundsException: Index: 1, Size: 0`
● As suggested, I added `android:hardwareAccelerated="true"` in Manifest but the crash still persist
  • Loading branch information
julfikar committed Apr 14, 2022
1 parent 23f3fb6 commit 9828e74
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
20 changes: 15 additions & 5 deletions AppCrash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,27 @@ function First({navigation}) {
}, 2000);
}, []);
return (
<View style={{flex: 1}}>
<Text>111</Text>
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}>
<BlurView
blurType={'dark'}
style={{height: 100, width: 100}}
blurAmount={15}>
<Text onPress={() => navigation.navigate('Second')}>CLICK HERE TO CRASH</Text>
</BlurView>
</View>
);
}
function Second({navigation}) {
return (
<View style={{flex: 1}}>
<BlurView blurType={"dark"} blurAmount={15}>
<Text>222</Text>
</BlurView>
{['222', '333', '444', '555', '666'].map(item => (
<BlurView
blurType={'dark'}
style={{height: 100, width: 100}}
blurAmount={15}>
<Text>{item}</Text>
</BlurView>
))}
</View>
);
}
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<uses-permission android:name="android.permission.INTERNET" />

<application
android:hardwareAccelerated="true"
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"react": "17.0.2",
"react-native": "0.67.4",
"react-native-safe-area-context": "^4.2.2",
"react-native-screens": "^3.13.1"
"react-native-screens": "https://github.com/software-mansion/react-native-screens.git#@wolewicki/fix-blurview-integration"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down
5 changes: 2 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5586,10 +5586,9 @@ react-native-safe-area-context@^4.2.2:
resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.2.2.tgz#e7989125bd905ae27433bd8579ed4bf90e686a38"
integrity sha512-uFyUDKHNGz6RHu7UKgf7twd7GRl4RbxY0blp/gB/ZAlZCsNYLiaWW6+HlRea4Vt3wmoZHgvMmW0l6OL2naW+iQ==

react-native-screens@^3.13.1:
"react-native-screens@https://github.com/software-mansion/react-native-screens.git#@wolewicki/fix-blurview-integration":
version "3.13.1"
resolved "https://registry.yarnpkg.com/react-native-screens/-/react-native-screens-3.13.1.tgz#b3b1c5788dca25a71668909f66d87fb35c5c5241"
integrity sha512-xcrnuUs0qUrGpc2gOTDY4VgHHADQwp80mwR1prU/Q0JqbZN5W3koLhuOsT6FkSRKjR5t40l+4LcjhHdpqRB2HA==
resolved "https://github.com/software-mansion/react-native-screens.git#295da829f6ffc1f998ef9971389ae7f55e550cd5"
dependencies:
react-freeze "^1.0.0"
warn-once "^0.1.0"
Expand Down

0 comments on commit 9828e74

Please sign in to comment.