mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-10-31 21:33:12 +08:00 
			
		
		
		
	解决Android 在RN0.27以上版本报错问题
This commit is contained in:
		| @@ -2,6 +2,10 @@ | |||||||
|  |  | ||||||
| 本组件是面向React Native提供热更新功能的组件,建议结合[Update服务](http://update.reactnative.cn/)使用。 | 本组件是面向React Native提供热更新功能的组件,建议结合[Update服务](http://update.reactnative.cn/)使用。 | ||||||
|  |  | ||||||
|  | ### 公告 | ||||||
|  |  | ||||||
|  | 因为React Native调整了okhttp的依赖,对于0.27以上版本的React Native,请安装1.1.x版本,对于0.26及以前版本,请安装1.0.x版本。 | ||||||
|  |  | ||||||
| ### 优势 | ### 优势 | ||||||
|  |  | ||||||
| 1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成CI。 | 1. 命令行工具&网页双端管理,版本发布过程简单便捷,完全可以集成CI。 | ||||||
|   | |||||||
| @@ -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 { | dependencies { | ||||||
|     compile 'com.facebook.react:react-native:+' |     compile 'com.facebook.react:react-native:+' | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,11 +4,10 @@ import android.content.Context; | |||||||
| import android.os.AsyncTask; | import android.os.AsyncTask; | ||||||
| import android.util.Log; | import android.util.Log; | ||||||
|  |  | ||||||
| import com.facebook.stetho.inspector.elements.ShadowDocument; | import okhttp3.OkHttpClient; | ||||||
| import com.squareup.okhttp.OkHttpClient; | import okhttp3.Request; | ||||||
| import com.squareup.okhttp.Request; | import okhttp3.Response; | ||||||
| import com.squareup.okhttp.Response; | import okhttp3.ResponseBody; | ||||||
| import com.squareup.okhttp.ResponseBody; |  | ||||||
|  |  | ||||||
| import org.json.JSONException; | import org.json.JSONException; | ||||||
| import org.json.JSONObject; | import org.json.JSONObject; | ||||||
|   | |||||||
| @@ -1,3 +1,9 @@ | |||||||
|  | ## 常见问题 | ||||||
|  |  | ||||||
|  | #### 0.27以上版本RN报错问题 | ||||||
|  |  | ||||||
|  | 升级到1.1.x即可解决。 | ||||||
|  |  | ||||||
| ## 高级指南 | ## 高级指南 | ||||||
|  |  | ||||||
| #### 过期的版本 | #### 过期的版本 | ||||||
|   | |||||||
| @@ -21,6 +21,14 @@ $ rnpm link react-native-update | |||||||
|  |  | ||||||
| * 注意 * | * 注意 * | ||||||
|  |  | ||||||
|  | 如果你的react-native版本小于或等于0.26,第二句请修改为 | ||||||
|  |  | ||||||
|  | ```bash | ||||||
|  | $ npm install --save react-native-update@1.0.x | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | * 注意 * | ||||||
|  |  | ||||||
| 如果访问极慢或者显示网络失败,请使用淘宝镜像:   | 如果访问极慢或者显示网络失败,请使用淘宝镜像:   | ||||||
| ```bash | ```bash | ||||||
| npm config set registry https://registry.npm.taobao.org --global | npm config set registry https://registry.npm.taobao.org --global | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "react-native-update", |   "name": "react-native-update", | ||||||
|   "version": "1.0.5", |   "version": "1.1.0", | ||||||
|   "description": "react-native hot update", |   "description": "react-native hot update", | ||||||
|   "main": "lib/index.js", |   "main": "lib/index.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
| @@ -23,7 +23,7 @@ | |||||||
|     "url": "https://github.com/reactnativecn/react-native-pushy/issues" |     "url": "https://github.com/reactnativecn/react-native-pushy/issues" | ||||||
|   }, |   }, | ||||||
|   "peerDependencies": { |   "peerDependencies": { | ||||||
|     "react-native": ">=0.18.0" |     "react-native": ">=0.27.0" | ||||||
|   }, |   }, | ||||||
|   "homepage": "https://github.com/reactnativecn/react-native-pushy#readme", |   "homepage": "https://github.com/reactnativecn/react-native-pushy#readme", | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 tdzl2003
					tdzl2003