| @@ -979,9 +979,9 @@ getAdView(){ | |||||
| render() { | render() { | ||||
| if (this.state.updating) { | |||||
| return this.getUpdateView(); | |||||
| } | |||||
| //if (this.state.updating) { | |||||
| // return this.getUpdateView(); | |||||
| //} | |||||
| return this.getAdView(); | return this.getAdView(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -116,6 +116,7 @@ android { | |||||
| targetSdkVersion rootProject.ext.targetSdkVersion | targetSdkVersion rootProject.ext.targetSdkVersion | ||||
| versionCode = getVersionCode() | versionCode = getVersionCode() | ||||
| versionName getVersionName() | versionName getVersionName() | ||||
| missingDimensionStrategy 'react-native-camera',"general" | |||||
| } | } | ||||
| android.applicationVariants.all { variant -> | android.applicationVariants.all { variant -> | ||||
| @@ -144,9 +145,9 @@ android { | |||||
| } | } | ||||
| buildTypes { | buildTypes { | ||||
| debug { | debug { | ||||
| buildConfigField "String", "API_HOST", "\"https://mall.youlane.cn/\"" | |||||
| buildConfigField "String", "CODEPUSH_HOST", "\"https://update.youlane.cn/\"" | |||||
| buildConfigField "String", "CODEPUSH_KEY", "\"8snO1yoHlvhEtBjr02zTr3g1comw4ksvOXqog\"" | |||||
| buildConfigField "String", "API_HOST", "\"https://admin.malls.iformall.com/\"" | |||||
| buildConfigField "String", "CODEPUSH_HOST", "\"https://update.malls.iformall.com/\"" | |||||
| buildConfigField "String", "CODEPUSH_KEY", "\"9rYZYySFD0ryN5wCD9YmjJkT55Kf4ksvOXqog\"" | |||||
| } | } | ||||
| release { | release { | ||||
| buildConfigField "String", "API_HOST", "\"https://admintest.malls.iformall.com/\"" | buildConfigField "String", "API_HOST", "\"https://admintest.malls.iformall.com/\"" | ||||
| @@ -187,7 +188,7 @@ dependencies { | |||||
| implementation project(':react-native-code-push') | implementation project(':react-native-code-push') | ||||
| implementation fileTree(dir: "libs", include: ["*.jar"]) | implementation fileTree(dir: "libs", include: ["*.jar"]) | ||||
| implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" | ||||
| implementation "com.facebook.react:react-native:+" // From node_modules | |||||
| implementation "com.facebook.react:react-native:0.59.9" // From node_modules | |||||
| } | } | ||||
| // Run this once to be able to run the application with BUCK | // Run this once to be able to run the application with BUCK | ||||
| @@ -1,4 +1,5 @@ | |||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
| xmlns:tools="http://schemas.android.com/tools" | |||||
| package="com.screenad"> | package="com.screenad"> | ||||
| <uses-permission android:name="android.permission.INTERNET" /> | <uses-permission android:name="android.permission.INTERNET" /> | ||||
| @@ -12,7 +13,9 @@ | |||||
| android:icon="@mipmap/ic_launcher" | android:icon="@mipmap/ic_launcher" | ||||
| android:roundIcon="@mipmap/ic_launcher_round" | android:roundIcon="@mipmap/ic_launcher_round" | ||||
| android:allowBackup="false" | android:allowBackup="false" | ||||
| android:theme="@style/AppTheme"> | |||||
| android:theme="@style/AppTheme" | |||||
| tools:replace="android:appComponentFactory" | |||||
| android:appComponentFactory="sss"> | |||||
| <activity | <activity | ||||
| android:name=".MainActivity" | android:name=".MainActivity" | ||||
| @@ -9,8 +9,10 @@ buildscript { | |||||
| supportLibVersion = "28.0.0" | supportLibVersion = "28.0.0" | ||||
| } | } | ||||
| repositories { | repositories { | ||||
| google() | |||||
| jcenter() | |||||
| maven { url 'https://maven.aliyun.com/repository/jcenter' } | |||||
| maven { url 'https://maven.aliyun.com/repository/google' } | |||||
| // google() | |||||
| // jcenter() | |||||
| } | } | ||||
| dependencies { | dependencies { | ||||
| classpath("com.android.tools.build:gradle:3.4.0") | classpath("com.android.tools.build:gradle:3.4.0") | ||||
| @@ -23,8 +25,10 @@ buildscript { | |||||
| allprojects { | allprojects { | ||||
| repositories { | repositories { | ||||
| mavenLocal() | mavenLocal() | ||||
| google() | |||||
| jcenter() | |||||
| maven { url 'https://maven.aliyun.com/repository/jcenter' } | |||||
| maven { url 'https://maven.aliyun.com/repository/google' } | |||||
| // google() | |||||
| // jcenter() | |||||
| maven { | maven { | ||||
| // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm | ||||
| url "$rootDir/../node_modules/react-native/android" | url "$rootDir/../node_modules/react-native/android" | ||||
| @@ -19,4 +19,6 @@ | |||||
| MYAPP_RELEASE_STORE_FILE=screenAd.keystore | MYAPP_RELEASE_STORE_FILE=screenAd.keystore | ||||
| MYAPP_RELEASE_KEY_ALIAS=screenAd | MYAPP_RELEASE_KEY_ALIAS=screenAd | ||||
| MYAPP_RELEASE_STORE_PASSWORD=formall2019 | MYAPP_RELEASE_STORE_PASSWORD=formall2019 | ||||
| MYAPP_RELEASE_KEY_PASSWORD=formall2019 | |||||
| MYAPP_RELEASE_KEY_PASSWORD=formall2019 | |||||
| #android.useAndroidX=true | |||||
| #android.enableJetifier=true | |||||
| @@ -0,0 +1,27 @@ | |||||
| 在项目目录执行如下: | |||||
| yarn | |||||
| npm install react-native-camera --save react-native link react-native-camera | |||||
| npm install --save-dev jetifier | |||||
| npx jetify -r | |||||
| yarn react-native run-android | |||||
| 然后修改node_modules/react-native-camera/android/build.gradle | |||||
| 把google()改成 | |||||
| maven { | |||||
| url 'https://maven.aliyun.com/repository/google' | |||||
| name 'Google' | |||||
| } | |||||
| 再执行 | |||||
| yarn react-native run-android | |||||
| 在android\app\src\main创建文件夹assets | |||||
| react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res | |||||
| #打包apk | |||||
| 进入android目录 | |||||
| 执行 ./gradlew app:assembleDebug | |||||
| 打包到android\app\build\outputs\apk\debug | |||||
| @@ -8,10 +8,11 @@ | |||||
| }, | }, | ||||
| "dependencies": { | "dependencies": { | ||||
| "code-push": "2.0.7", | "code-push": "2.0.7", | ||||
| "link": "^1.5.1", | |||||
| "react": "16.8.3", | "react": "16.8.3", | ||||
| "react-native": "0.59.9", | |||||
| "react-native": "^0.59.9", | |||||
| "react-native-animatable": "^1.3.2", | "react-native-animatable": "^1.3.2", | ||||
| "react-native-camera": "^1.12.0", | |||||
| "react-native-camera": "^2.9.0", | |||||
| "react-native-code-push": "5.6.1", | "react-native-code-push": "5.6.1", | ||||
| "react-native-device-info": "^2.1.2", | "react-native-device-info": "^2.1.2", | ||||
| "react-native-shadow": "^1.2.2", | "react-native-shadow": "^1.2.2", | ||||
| @@ -26,6 +27,7 @@ | |||||
| "@babel/runtime": "^7.4.5", | "@babel/runtime": "^7.4.5", | ||||
| "babel-jest": "^24.8.0", | "babel-jest": "^24.8.0", | ||||
| "jest": "^24.8.0", | "jest": "^24.8.0", | ||||
| "jetifier": "^2.0.0", | |||||
| "metro-react-native-babel-preset": "^0.54.1", | "metro-react-native-babel-preset": "^0.54.1", | ||||
| "react-test-renderer": "16.8.3" | "react-test-renderer": "16.8.3" | ||||
| }, | }, | ||||