react-native-linear-gradient 使用安装

今天在使用react-native-linear-gradient的时候遇到了问题,按照官网的做法,居然编译不过去,后来查了网络,不用那么麻烦

1)npm install --save react-native-liner-gradient

2)react-native link react-native-linear-gradient

3)这时候编译会报错

Build file 'E:\working\reactnative\ysj\node_modules\react-native-linear-gradient\android\build.gradle' line: 21错误

去那个文件 改了他

dependencies {

    compileOnly "com.facebook.react:react-native:+"

}

改成

dependencies {

    provided"com.facebook.react:react-native:+"

}

4)再编译还会报错

  1. java.io.IOException: Could not delete path 'E:\working\reactnative\ysj\android\app\build\generated\source\r\debug\android'

错误

去在工程的android下 运行gradlew.bat clean即可

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值