mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 18:09:31 +08:00
react-native-navigation android 编译通过
This commit is contained in:
parent
a1acc0a37d
commit
c95496b6a4
7 changed files with 62 additions and 8 deletions
|
@ -105,6 +105,7 @@ android {
|
||||||
applicationId "com.timepill"
|
applicationId "com.timepill"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
|
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
}
|
}
|
||||||
|
@ -141,6 +142,7 @@ dependencies {
|
||||||
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:+" // From node_modules
|
||||||
|
implementation project(':react-native-navigation')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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,15 +1,16 @@
|
||||||
package com.timepill;
|
package com.timepill;
|
||||||
|
|
||||||
import com.facebook.react.ReactActivity;
|
import com.facebook.react.ReactActivity;
|
||||||
|
import com.reactnativenavigation.NavigationActivity;
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
public class MainActivity extends NavigationActivity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the main component registered from JavaScript.
|
* Returns the name of the main component registered from JavaScript.
|
||||||
* This is used to schedule rendering of the component.
|
* This is used to schedule rendering of the component.
|
||||||
*/
|
*/
|
||||||
@Override
|
// @Override
|
||||||
protected String getMainComponentName() {
|
// protected String getMainComponentName() {
|
||||||
return "Timepill";
|
// return "Timepill";
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,43 @@ import com.facebook.soloader.SoLoader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class MainApplication extends Application implements ReactApplication {
|
import com.reactnativenavigation.NavigationApplication;
|
||||||
|
import com.reactnativenavigation.react.NavigationReactNativeHost;
|
||||||
|
import com.reactnativenavigation.react.ReactGateway;
|
||||||
|
|
||||||
|
|
||||||
|
public class MainApplication extends NavigationApplication {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ReactGateway createReactGateway() {
|
||||||
|
ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
|
||||||
|
@Override
|
||||||
|
protected String getJSMainModuleName() {
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return new ReactGateway(this, isDebug(), host);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDebug() {
|
||||||
|
return BuildConfig.DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<ReactPackage> getPackages() {
|
||||||
|
// Add additional packages you require here
|
||||||
|
// No need to add RnnPackage and MainReactPackage
|
||||||
|
return Arrays.<ReactPackage>asList(
|
||||||
|
// eg. new VectorIconsPackage()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ReactPackage> createAdditionalReactPackages() {
|
||||||
|
return getPackages();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
buildToolsVersion = "28.0.3"
|
buildToolsVersion = "28.0.3"
|
||||||
minSdkVersion = 16
|
minSdkVersion = 18
|
||||||
compileSdkVersion = 28
|
compileSdkVersion = 28
|
||||||
targetSdkVersion = 28
|
targetSdkVersion = 28
|
||||||
supportLibVersion = "28.0.0"
|
supportLibVersion = "28.0.0"
|
||||||
|
@ -29,5 +29,6 @@ allprojects {
|
||||||
// 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"
|
||||||
}
|
}
|
||||||
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
rootProject.name = 'Timepill'
|
rootProject.name = 'Timepill'
|
||||||
|
|
||||||
include ':app'
|
include ':app'
|
||||||
|
|
||||||
|
include ':react-native-navigation'
|
||||||
|
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')
|
||||||
|
|
10
package-lock.json
generated
10
package-lock.json
generated
|
@ -4170,6 +4170,8 @@
|
||||||
},
|
},
|
||||||
"jest": {
|
"jest": {
|
||||||
"version": "24.7.1",
|
"version": "24.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/jest/-/jest-24.7.1.tgz",
|
||||||
|
"integrity": "sha512-AbvRar5r++izmqo5gdbAjTeA6uNRGoNRuj5vHB0OnDXo2DXWZJVuaObiGgtlvhKb+cWy2oYbQSfxv7Q7GjnAtA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"import-local": "^2.0.0",
|
"import-local": "^2.0.0",
|
||||||
|
@ -5867,6 +5869,8 @@
|
||||||
},
|
},
|
||||||
"metro-react-native-babel-preset": {
|
"metro-react-native-babel-preset": {
|
||||||
"version": "0.53.1",
|
"version": "0.53.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.53.1.tgz",
|
||||||
|
"integrity": "sha512-Uf8EGL8kIPhDkoSdAAysNPxPQclUS2R1QC4cwnc8bkk2f6yqGn+1CorfiY9AaqlLEth5mKQqdtRYFDTFfB9QyA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||||
|
@ -6839,6 +6843,8 @@
|
||||||
},
|
},
|
||||||
"react": {
|
"react": {
|
||||||
"version": "16.8.3",
|
"version": "16.8.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/react/-/react-16.8.3.tgz",
|
||||||
|
"integrity": "sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"loose-envify": "^1.1.0",
|
"loose-envify": "^1.1.0",
|
||||||
"object-assign": "^4.1.1",
|
"object-assign": "^4.1.1",
|
||||||
|
@ -6894,6 +6900,8 @@
|
||||||
},
|
},
|
||||||
"react-native": {
|
"react-native": {
|
||||||
"version": "0.59.4",
|
"version": "0.59.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-native/-/react-native-0.59.4.tgz",
|
||||||
|
"integrity": "sha512-etnXQp9IZgC8Vj5gsxZEDP4xRjJVNIj5/BSE1WcNAONG6tu6+mDBntx1jxHInwh61WYNgoQJuQGsbN5Na59ZDw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.0.0",
|
"@babel/runtime": "^7.0.0",
|
||||||
"@react-native-community/cli": "^1.2.1",
|
"@react-native-community/cli": "^1.2.1",
|
||||||
|
@ -7094,6 +7102,8 @@
|
||||||
},
|
},
|
||||||
"react-test-renderer": {
|
"react-test-renderer": {
|
||||||
"version": "16.8.3",
|
"version": "16.8.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-test-renderer/-/react-test-renderer-16.8.3.tgz",
|
||||||
|
"integrity": "sha512-rjJGYebduKNZH0k1bUivVrRLX04JfIQ0FKJLPK10TAb06XWhfi4gTobooF9K/DEFNW98iGac3OSxkfIJUN9Mdg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"object-assign": "^4.1.1",
|
"object-assign": "^4.1.1",
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node node_modules/react-native/local-cli/cli.js start",
|
"start": "node node_modules/react-native/local-cli/cli.js start",
|
||||||
"test": "jest"
|
"test": "jest",
|
||||||
|
"android": "cd ./android && ./gradlew app:assembleDebug && ./gradlew installDebug"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "16.8.3",
|
"react": "16.8.3",
|
||||||
|
|
Loading…
Reference in a new issue