跳到主要内容

已知问题

initialRouteName

如果您使用 底部标签抽屉 导航器,并且 initialRouteName 指向的不是第一个屏幕,则 react-native-performance 可能会报告不准确的测量结果。要解决此问题,请确保将 backBehavior 设置为 history

diff
- <Tab.Navigator initialRouteName="Screen2">
+ <Tab.Navigator initialRouteName="Screen2" backBehavior="history">
<Tab.Screen
name="Screen1"
component={Screen1}
/>
<Tab.Screen
name="Screen2"
component={Screen2}
/>
</Tab.Navigator>
diff
- <Tab.Navigator initialRouteName="Screen2">
+ <Tab.Navigator initialRouteName="Screen2" backBehavior="history">
<Tab.Screen
name="Screen1"
component={Screen1}
/>
<Tab.Screen
name="Screen2"
component={Screen2}
/>
</Tab.Navigator>

此错误已在 问题中进行跟踪。

Kotlin 编译错误

如果您是从一个裸 React-Native 项目进行构建,则可能会遇到以下错误

Build file '/Users/<youruser>/repos/ShopifyPerformance/node_modules/@shopify/react-native-performance/android/build.gradle' line: 3 * What went wrong: A problem occurred evaluating project ':shopify_react-native-performance'. > Plugin with id 'kotlin-android' not found.
Build file '/Users/<youruser>/repos/ShopifyPerformance/node_modules/@shopify/react-native-performance/android/build.gradle' line: 3 * What went wrong: A problem occurred evaluating project ':shopify_react-native-performance'. > Plugin with id 'kotlin-android' not found.

如果出现这种情况,您需要将 Kotlin Gradle 插件添加到您的顶级 Android build.gradle 文件中。

buildscript { ext.kotlin_version = '1.6.21' ... dependencies { ... classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version') } }
buildscript { ext.kotlin_version = '1.6.21' ... dependencies { ... classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version') } }