Skip to content

Commit 66c4d8a

Browse files
committed
1 parent 69019e5 commit 66c4d8a

14 files changed

Lines changed: 159 additions & 256 deletions

File tree

android/app/build.gradle

Lines changed: 58 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,63 @@
11
apply plugin: "com.android.application"
2-
2+
apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
44

55
/**
66
* This is the configuration block to customize your React Native Android app.
77
* By default you don't need to apply any configuration, just uncomment the lines you need.
88
*/
99

10-
project.ext.react = [
11-
entryFile: "index.js",
12-
enableHermes: true, // clean and rebuild if changing
13-
]
10+
/**
11+
* This is the configuration block to customize your React Native Android app.
12+
* By default you don't need to apply any configuration, just uncomment the lines you need.
13+
*/
14+
react {
15+
/* Folders */
16+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
17+
// root = file("../../")
18+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
19+
// reactNativeDir = file("../../node_modules/react-native")
20+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
21+
// codegenDir = file("../../node_modules/@react-native/codegen")
22+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
23+
// cliFile = file("../../node_modules/react-native/cli.js")
24+
25+
/* Variants */
26+
// The list of variants to that are debuggable. For those we're going to
27+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
28+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
29+
// debuggableVariants = ["liteDebug", "prodDebug"]
30+
31+
/* Bundling */
32+
// A list containing the node command and its flags. Default is just 'node'.
33+
// nodeExecutableAndArgs = ["node"]
34+
//
35+
// The command to run when bundling. By default is 'bundle'
36+
// bundleCommand = "ram-bundle"
37+
//
38+
// The path to the CLI configuration file. Default is empty.
39+
// bundleConfig = file(../rn-cli.config.js)
40+
//
41+
// The name of the generated asset file containing your JS bundle
42+
// bundleAssetName = "MyApplication.android.bundle"
43+
//
44+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
45+
// entryFile = file("../js/MyApplication.android.js")
46+
//
47+
// A list of extra flags to pass to the 'bundle' commands.
48+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
49+
// extraPackagerArgs = []
50+
51+
/* Hermes Commands */
52+
// The hermes compiler command to run. By default it is 'hermesc'
53+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
54+
//
55+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
56+
// hermesFlags = ["-O", "-output-source-map"]
57+
58+
/* Autolinking */
59+
autolinkLibrariesWithApp()
60+
}
1461

1562
//apply from: "../../node_modules/react-native/react.gradle"
1663

@@ -38,23 +85,14 @@ def enableProguardInReleaseBuilds = true
3885
* The preferred build flavor of JavaScriptCore.
3986
*
4087
* For example, to use the international variant, you can use:
41-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
88+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
4289
*
4390
* The international variant includes ICU i18n library and necessary data
4491
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
45-
* give correct results when using with locales other than en-US. Note that
92+
* give correct results when using with locales other than en-US. Note that
4693
* this variant is about 6MiB larger per architecture than default.
4794
*/
48-
def jscFlavor = 'org.webkit:android-jsc:+'
49-
50-
/**
51-
* Whether to enable the Hermes VM.
52-
*
53-
* This should be set on project.ext.react and mirrored here. If it is not set
54-
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
55-
* and the benefits of using Hermes will therefore be sharply reduced.
56-
*/
57-
def enableHermes = project.ext.react.get("enableHermes", false);
95+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
5896

5997
/**
6098
* Architectures to build native code for in debug.
@@ -75,9 +113,10 @@ if (keystorePropertiesFile.exists() && !keystorePropertiesFile.isDirectory()) {
75113

76114
android {
77115
ndkVersion rootProject.ext.ndkVersion
116+
buildToolsVersion rootProject.ext.buildToolsVersion
117+
compileSdk rootProject.ext.compileSdkVersion
78118

79-
compileSdkVersion rootProject.ext.compileSdkVersion
80-
119+
namespace 'fr.amicaleinsat.application'
81120
defaultConfig {
82121
applicationId 'fr.amicaleinsat.application'
83122
minSdkVersion rootProject.ext.minSdkVersion
@@ -131,14 +170,6 @@ android {
131170
dependencies {
132171
// The version of react-native is set by the React Native Gradle Plugin
133172
implementation("com.facebook.react:react-android")
134-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
135-
136-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
137-
exclude group:'com.facebook.flipper'
138-
exclude group:'com.squareup.okhttp3', module:'okhttp'
139-
}
140-
141-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
142173
if (hermesEnabled.toBoolean()) {
143174
implementation("com.facebook.react:hermes-android")
144175
} else {
@@ -159,5 +190,3 @@ task copyDownloadableDepsToLibs(type: Copy) {
159190
from configurations.implementation
160191
into 'libs'
161192
}
162-
163-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

android/app/src/debug/java/fr/amicaleinsat/application/ReactNativeFlipper.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
android:roundIcon="@mipmap/ic_launcher_round"
1818
android:allowBackup="false"
1919
android:theme="@style/AppTheme"
20-
android:usesCleartextTraffic="true"
20+
android:supportsRtl="true"
2121
>
2222

2323
<!-- START NOTIFICATIONS -->

android/app/src/main/java/fr/amicaleinsat/application/MainActivity.java

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package fr.amicaleinsat.application
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
class MainActivity : ReactActivity() {
9+
10+
/**
11+
* Returns the name of the main component registered from JavaScript. This is used to schedule
12+
* rendering of the component.
13+
*/
14+
override fun getMainComponentName(): String = "Campus"
15+
16+
/**
17+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19+
*/
20+
override fun createReactActivityDelegate(): ReactActivityDelegate =
21+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22+
}
23+

android/app/src/main/java/fr/amicaleinsat/application/MainApplication.java

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)