小编Bet*_*IGM的帖子

在 build.grandle 中指定 android SDK Build Tools 版本不会消除 React Native 中的警告

当我执行 npx react-native run-android 时收到此警告

WARNING:: The specified Android SDK Build Tools version (29.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.1.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Run Code Online (Sandbox Code Playgroud)

尽管我已经在 build.grandle 文件中修改了此参数,如下所示:

buildscript {
    ext {
        buildToolsVersion = '30.0.2'
        minSdkVersion = 21
        compileSdkVersion …
Run Code Online (Sandbox Code Playgroud)

android reactjs android-gradle-plugin react-native

5
推荐指数
0
解决办法
1786
查看次数

React Native 将 onPress 调用的接口声明为 void 打字稿错误

我正在尝试从 TouchableOpacity 组件内的 onPress 调用中消除此打字稿错误。

Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock).

No overload matches this call.
  Overload 1 of 2, '(props: (TouchableOpacityProps & GenericTouchableProps) | Readonly<TouchableOpacityProps & GenericTouchableProps>): TouchableOpacity', gave the following error.
    Type 'void' is not assignable to type '(((event: GestureResponderEvent) => void) & (() => void)) | undefined'.
  Overload 2 of 2, '(props: TouchableOpacityProps & GenericTouchableProps, context: any): TouchableOpacity', gave the following error.
    Type 'void' …
Run Code Online (Sandbox Code Playgroud)

javascript typescript reactjs react-native

2
推荐指数
1
解决办法
2675
查看次数