diff --git a/ReactNativeClient/android/app/build.gradle b/ReactNativeClient/android/app/build.gradle index 5a28ff37a..8d9eba099 100644 --- a/ReactNativeClient/android/app/build.gradle +++ b/ReactNativeClient/android/app/build.gradle @@ -134,6 +134,12 @@ android { targetSdkVersion rootProject.ext.targetSdkVersion versionCode 1 versionName "1.0" + + // https://github.com/react-native-community/react-native-camera/issues/2138 + missingDimensionStrategy 'react-native-camera', 'general' + + // Needed to fix: The number of method references in a .dex file cannot exceed 64K + multiDexEnabled true } splits { abi { @@ -184,7 +190,7 @@ dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - + implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { @@ -207,6 +213,9 @@ dependencies { } else { implementation jscFlavor } + + // Needed to fix: The number of method references in a .dex file cannot exceed 64K + implementation 'com.android.support:multidex:2.0.1' } // Run this once to be able to run the application with BUCK diff --git a/ReactNativeClient/android/app/src/main/AndroidManifest.xml b/ReactNativeClient/android/app/src/main/AndroidManifest.xml index 9859881f4..e78ec2bc1 100644 --- a/ReactNativeClient/android/app/src/main/AndroidManifest.xml +++ b/ReactNativeClient/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="net.cozic.joplin"> diff --git a/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java b/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java index 6176aeb31..7f86c7b41 100644 --- a/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java +++ b/ReactNativeClient/android/app/src/main/java/net/cozic/joplin/MainApplication.java @@ -10,9 +10,17 @@ import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.lang.reflect.InvocationTargetException; import java.util.List; +import androidx.multidex.MultiDex; public class MainApplication extends Application implements ReactApplication { + // Needed to fix: The number of method references in a .dex file cannot exceed 64K + @Override + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } + private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override diff --git a/ReactNativeClient/index.js b/ReactNativeClient/index.js index 8b51ee627..a20751639 100644 --- a/ReactNativeClient/index.js +++ b/ReactNativeClient/index.js @@ -1,3 +1,11 @@ -const {main} = require('./main.js'); +// const {main} = require('./main.js'); -main(); +// main(); + + +import {AppRegistry} from 'react-native'; +const {Root} = require('./root.js'); +// import App from './App'; +// import {name as appName} from './app.json'; + +AppRegistry.registerComponent('Joplin', () => Root); diff --git a/ReactNativeClient/main.js b/ReactNativeClient/main.js index 5fa650370..08756e60a 100644 --- a/ReactNativeClient/main.js +++ b/ReactNativeClient/main.js @@ -1,3 +1,5 @@ +// TODO: NOT USED ANYMORE, BUT COPY CONTENT BELOW TO index.js + // Note about the application structure: // - The user interface and its state is managed by React/Redux. // - Persistent storage to SQLite and Web API is handled outside of React/Redux using regular JavaScript (no middleware, no thunk, etc.). @@ -8,29 +10,39 @@ // console.disableYellowBox = true -import {YellowBox, AppRegistry} from 'react-native'; -YellowBox.ignoreWarnings([ - 'Require cycle: node_modules/react-native-', - 'Require cycle: node_modules/rn-fetch-blob', - 'Warning: componentWillReceiveProps has been renamed', - 'Warning: componentWillUpdate has been renamed', - 'Warning: componentWillMount has been renamed', -]); -const {Root} = require('./root.js'); +// import {YellowBox, AppRegistry} from 'react-native'; +// YellowBox.ignoreWarnings([ +// 'Require cycle: node_modules/react-native-', +// 'Require cycle: node_modules/rn-fetch-blob', +// 'Warning: componentWillReceiveProps has been renamed', +// 'Warning: componentWillUpdate has been renamed', +// 'Warning: componentWillMount has been renamed', +// ]); +// const {Root} = require('./root.js'); -// Disable buggy Fast Refresh -// NOTE: not working - can make the app go into an infinite crash/restart loop -// if (__DEV__) { -// const { DevSettings } = NativeModules; -// DevSettings.setHotLoadingEnabled(false); -// DevSettings.setLiveReloadEnabled(false); +// // Disable buggy Fast Refresh +// // NOTE: not working - can make the app go into an infinite crash/restart loop +// // if (__DEV__) { +// // const { DevSettings } = NativeModules; +// // DevSettings.setHotLoadingEnabled(false); +// // DevSettings.setLiveReloadEnabled(false); +// // } + +// function main() { +// AppRegistry.registerComponent('Joplin', () => Root); +// console.ignoredYellowBox = ['Remote debugger']; +// // Note: The final part of the initialization process is in +// // AppComponent.componentDidMount(), when the application is ready. // } -function main() { - AppRegistry.registerComponent('Joplin', () => Root); - console.ignoredYellowBox = ['Remote debugger']; - // Note: The final part of the initialization process is in - // AppComponent.componentDidMount(), when the application is ready. -} +// module.exports = {main}; -module.exports = {main}; + + + +// import {AppRegistry} from 'react-native'; +// const {Root} = require('./root.js'); +// // import App from './App'; +// // import {name as appName} from './app.json'; + +// AppRegistry.registerComponent('Joplin', () => Root); diff --git a/ReactNativeClient/package-lock.json b/ReactNativeClient/package-lock.json index 86bf4957d..6c83d1b02 100644 --- a/ReactNativeClient/package-lock.json +++ b/ReactNativeClient/package-lock.json @@ -10703,9 +10703,12 @@ } }, "react-native-action-button": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/react-native-action-button/-/react-native-action-button-2.6.9.tgz", - "integrity": "sha1-+WCdZaxAqsCuHCvQXceogROV1is=" + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/react-native-action-button/-/react-native-action-button-2.8.5.tgz", + "integrity": "sha512-BvGZpzuGeuFR2Y6j93+vKiSqDhsF87VHvNXFs/qEYKfzT4b1ASAT/GQbgS6gNt4jRJCUnJWYrIwlBzRjesZQmQ==", + "requires": { + "prop-types": "^15.5.10" + } }, "react-native-camera": { "version": "3.40.0", @@ -10821,9 +10824,9 @@ } }, "react-native-popup-dialog": { - "version": "0.9.35", - "resolved": "https://registry.npmjs.org/react-native-popup-dialog/-/react-native-popup-dialog-0.9.35.tgz", - "integrity": "sha1-3yO918IYNphTUSXkaLjX/81bXG0=", + "version": "0.9.41", + "resolved": "https://registry.npmjs.org/react-native-popup-dialog/-/react-native-popup-dialog-0.9.41.tgz", + "integrity": "sha1-6006ApVHk3nM1qZWhozgNiQ/0h4=", "requires": { "babel-plugin-flow-react-proptypes": "^5.1.1", "prop-types": "^15.5.8" diff --git a/ReactNativeClient/package.json b/ReactNativeClient/package.json index 85e36e468..b2f1eeec2 100644 --- a/ReactNativeClient/package.json +++ b/ReactNativeClient/package.json @@ -54,7 +54,7 @@ "react": "16.13.1", "react-async": "^10.0.0", "react-native": "0.63.3", - "react-native-action-button": "^2.6.9", + "react-native-action-button": "^2.8.5", "react-native-camera": "^3.40.0", "react-native-datepicker": "^1.7.2", "react-native-device-info": "^6.2.0", @@ -65,7 +65,7 @@ "react-native-fs": "^2.16.6", "react-native-image-picker": "^2.3.4", "react-native-image-resizer": "^1.3.0", - "react-native-popup-dialog": "^0.9.35", + "react-native-popup-dialog": "^0.9.41", "react-native-popup-menu": "^0.10.0", "react-native-quick-actions": "^0.3.13", "react-native-securerandom": "^1.0.0-rc.0", diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index 76f259efb..8cb23293c 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -8,7 +8,7 @@ const { connect, Provider } = require('react-redux'); const { BackButtonService } = require('lib/services/back-button.js'); const NavService = require('lib/services/NavService.js'); const AlarmService = require('lib/services/AlarmService.js').default; -const AlarmServiceDriver = require('lib/services/AlarmServiceDriver').default; +// const AlarmServiceDriver = require('lib/services/AlarmServiceDriver').default; const Alarm = require('lib/models/Alarm').default; const { createStore, applyMiddleware } = require('redux'); const reduxSharedMiddleware = require('lib/components/shared/reduxSharedMiddleware'); @@ -442,7 +442,7 @@ async function initialize(dispatch) { Resource.fsDriver_ = fsDriver; FileApiDriverLocal.fsDriver_ = fsDriver; - AlarmService.setDriver(new AlarmServiceDriver()); + // AlarmService.setDriver(new AlarmServiceDriver()); AlarmService.setLogger(mainLogger); try {