android - 在 react native 中发布 apk 时出现“react-native-gesture-handler”错误

标签 android reactjs react-native apk

我想发布我的项目并生成.apk 文件。我流过 native 文档,但在终端中使用 gradlew assembleRelease 命令后发生此错误。 如何解决?

Configure project :app WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Task :react-native-gesture-handler:compileReleaseJavaWithJavac Note: C:\dev\react workSpace\SafarBeCom\node_modules\react-native-gesture-handler\android\src\main\java\com\swmansion\gesturehandler\react\RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

最佳答案

我经历过这个,你需要改变 app/build.gradle 文件,在 dependencies 部分,改变:

...
dependencies {
    compile project(':react-native-gesture-handler')
}
...

到:

...
dependencies {
    implementation project(':react-native-gesture-handler')
}
...

和:

您需要将项目的所有compile语句都改成实现。

关于android - 在 react native 中发布 apk 时出现“react-native-gesture-handler”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54407321/

相关文章:

Android:C2DM 在没有通知的情况下更改 registration_id?

android - 是否可以更改我的主题 (AppCompat) 中的 AppBar 文本颜色?

CSSTransition 未导入 - 类型无效

reactjs - 类型 'Dispatch<SetStateAction<any[]>>' 不可分配给类型 '(values?: string) => void'

reactjs - reselect createStructuredSelector 如何在 Typescript 中工作?

android - Kotlin 文档不支持像 '<p>' 这样的标签

iPhone/Android SMS 截获并重定向到应用程序

javascript - 如何将单个状态 Prop 重置为其初始值

javascript - 标识符 'reducer' 已声明

react-native - 如何在 native 天才聊天中显示与我聊天的人的姓名