From 702ddbe011412607d845219b266f1295fa58fd6d Mon Sep 17 00:00:00 2001 From: tdzl2003 Date: Mon, 27 Jun 2016 21:02:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3Android=20=E5=9C=A8RN0.27?= =?UTF-8?q?=E4=BB=A5=E4=B8=8A=E7=89=88=E6=9C=AC=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ android/build.gradle | 7 +++++++ .../java/cn/reactnative/modules/update/DownloadTask.java | 9 ++++----- docs/faq_advance.md | 6 ++++++ docs/guide.md | 8 ++++++++ package.json | 4 ++-- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e0c587b..0773c40 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ 本组件是面向React Native提供热更新功能的组件,建议结合[Update服务](http://update.reactnative.cn/)使用。 +### 公告 + +因为React Native调整了okhttp的依赖,对于0.27以上版本的React Native,请安装1.1.x版本,对于0.26及以前版本,请安装1.0.x版本。 + ### 优势 1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成CI。 diff --git a/android/build.gradle b/android/build.gradle index b1b3d6e..7d92541 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -19,6 +19,13 @@ android { } } +repositories { + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$rootDir/../../node_modules/react-native/android" + } +} + dependencies { compile 'com.facebook.react:react-native:+' } diff --git a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java index dbacaed..761f6f0 100644 --- a/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java +++ b/android/src/main/java/cn/reactnative/modules/update/DownloadTask.java @@ -4,11 +4,10 @@ import android.content.Context; import android.os.AsyncTask; import android.util.Log; -import com.facebook.stetho.inspector.elements.ShadowDocument; -import com.squareup.okhttp.OkHttpClient; -import com.squareup.okhttp.Request; -import com.squareup.okhttp.Response; -import com.squareup.okhttp.ResponseBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; import org.json.JSONException; import org.json.JSONObject; diff --git a/docs/faq_advance.md b/docs/faq_advance.md index 5013dc8..b1db694 100644 --- a/docs/faq_advance.md +++ b/docs/faq_advance.md @@ -1,3 +1,9 @@ +## 常见问题 + +#### 0.27以上版本RN报错问题 + +升级到1.1.x即可解决。 + ## 高级指南 #### 过期的版本 diff --git a/docs/guide.md b/docs/guide.md index 11e3155..43e76b3 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -21,6 +21,14 @@ $ rnpm link react-native-update * 注意 * +如果你的react-native版本小于或等于0.26,第二句请修改为 + +```bash +$ npm install --save react-native-update@1.0.x +``` + +* 注意 * + 如果访问极慢或者显示网络失败,请使用淘宝镜像: ```bash npm config set registry https://registry.npm.taobao.org --global diff --git a/package.json b/package.json index b623f63..5c8663f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-update", - "version": "1.0.5", + "version": "1.1.0", "description": "react-native hot update", "main": "lib/index.js", "scripts": { @@ -23,7 +23,7 @@ "url": "https://github.com/reactnativecn/react-native-pushy/issues" }, "peerDependencies": { - "react-native": ">=0.18.0" + "react-native": ">=0.27.0" }, "homepage": "https://github.com/reactnativecn/react-native-pushy#readme", "dependencies": {