Skip to content

Commit 26b8021

Browse files
authored
Merge pull request #5 from handi-dev/react-native-064
React native 0.64.0
2 parents ead5349 + 1e1e03f commit 26b8021

File tree

35 files changed

+2978
-12271
lines changed

35 files changed

+2978
-12271
lines changed

.flowconfig

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
; Ignore polyfills
99
node_modules/react-native/Libraries/polyfills/.*
1010

11-
; These should not be required directly
12-
; require from fbjs/lib instead: require('fbjs/lib/warning')
13-
node_modules/warning/.*
14-
1511
; Flow doesn't support platforms
1612
.*/Libraries/Utilities/LoadingView.js
1713

@@ -30,6 +26,8 @@ emoji=true
3026
esproposal.optional_chaining=enable
3127
esproposal.nullish_coalescing=enable
3228

29+
exact_by_default=true
30+
3331
module.file_ext=.js
3432
module.file_ext=.json
3533
module.file_ext=.ios.js
@@ -44,10 +42,6 @@ suppress_type=$FlowFixMe
4442
suppress_type=$FlowFixMeProps
4543
suppress_type=$FlowFixMeState
4644

47-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
48-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
49-
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
50-
5145
[lints]
5246
sketchy-null-number=warn
5347
sketchy-null-mixed=warn
@@ -58,7 +52,6 @@ deprecated-type=warn
5852
unsafe-getters-setters=warn
5953
unnecessary-invariant=warn
6054
signature-verification-failure=warn
61-
deprecated-utility=error
6255

6356
[strict]
6457
deprecated-type
@@ -70,4 +63,4 @@ untyped-import
7063
untyped-type-import
7164

7265
[version]
73-
^0.122.0
66+
^0.137.0

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
*.pbxproj -text
1+
# Windows files should use crlf line endings
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
*.bat text eol=crlf

README.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# react-native-boilerplate
22

33
## What is React Native Boilerplate
4-
It is a template that you can clone and reuse for every project. It is starting point for React Native application.
4+
5+
It is a template that you can clone and reuse for every project. It is starting point for React Native application.
56

67
## React Native Boilerplate
78

89
consist of:
910

10-
- react-native": "0.63.4"
11+
- react-native": "0.64.0"
1112
- react-navigation and its dependencies
1213
- redux, redux persist and redux thunk
1314
- react native vector icons
@@ -20,7 +21,24 @@ consist of:
2021
3. Remove `.git` folder, `rm -rf .git`
2122
4. Use [React Native Rename](https://github.com/junedomingo/react-native-rename) to update project name `$ npx react-native-rename <newName>`
2223
5. Run `npm install` to install dependencies
23-
6. Run `npx pod-install` from root of your project
24+
6. Run `npx pod-install` from root of your project.
25+
26+
If you got error like: `The version of CocoaPods used to generate the lockfile (x.x.x) is higher than the version of the current executable (x.x.x)`, then you can upgrade your cocoapods version.
27+
28+
If you install cocoapods using homebrew, you can using this command: `brew upgrade cocoapods` if that does not work, try `brew install cocoapods`.
29+
30+
If you previously install using `gem`, then use this command and run on your terminal: `sudo gem install cocoapods`.
31+
32+
make sure your cocoapods version is updated after run that command.
33+
34+
To check your current version of cocoapods, run `pod --version`.
35+
36+
After that, don't forget to execute in your terminal `pod repo update`
37+
38+
And, finally, run `npx pod-install`. Those methods must be solved that problem.
39+
40+
Last method: If All the above steps not work, remove `Podfile.lock` in folder `ios` , and then run `npx pod-install`.
41+
2442
7. Start the packager with `npm start`
2543
8. Connect your device or use emulator that's installed in your pc
2644
9. Run the test application:
@@ -34,18 +52,20 @@ consist of:
3452

3553
## List of Q & A:
3654

37-
#### I got error `Error: spawn ./gradlew EACCES` when run `npx react-native run-android`.
38-
Run this command `chmod 755 android/gradlew` from your root project directory
55+
#### I got error `Error: spawn ./gradlew EACCES` when run `npx react-native run-android`.
56+
57+
Run this command `chmod 755 android/gradlew` from your root project directory
58+
59+
#### I got error `Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.`
3960

40-
#### I got error `Error: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.`
41-
- Go to your Project -> Android
42-
- Create a file local.properties
43-
- Open the file
44-
- Paste your Android SDK path depending on the operating system:
61+
- Go to your Project -> Android
62+
- Create a file local.properties
63+
- Open the file
64+
- Paste your Android SDK path depending on the operating system:
4565

46-
- Windows:
47-
sdk.dir=C:/Users/`USERNAME`/AppData/Local/Android/sdk
48-
- Linux or MacOS
49-
sdk.dir=/home/`USERNAME`/Android/sdk
66+
- Windows:
67+
sdk.dir=C:/Users/`USERNAME`/AppData/Local/Android/sdk
68+
- Linux or MacOS
69+
sdk.dir=/home/`USERNAME`/Android/sdk
5070

51-
- Replace `USERNAME` with your PC username
71+
- Replace `USERNAME` with your PC username

_editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Windows files
2+
[*.bat]
3+
end_of_line = crlf
File renamed without changes.

android/app/build.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
121121
def enableHermes = project.ext.react.get("enableHermes", false);
122122

123123
android {
124+
ndkVersion rootProject.ext.ndkVersion
125+
124126
compileSdkVersion rootProject.ext.compileSdkVersion
125127

126128
compileOptions {
@@ -169,11 +171,12 @@ android {
169171
variant.outputs.each { output ->
170172
// For each separate APK per architecture, set a unique version code as described here:
171173
// https://developer.android.com/studio/build/configure-apk-splits.html
174+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172175
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
173176
def abi = output.getFilter(OutputFile.ABI)
174177
if (abi != null) { // null for the universal-debug, universal-release variants
175178
output.versionCodeOverride =
176-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
179+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
177180
}
178181

179182
}
@@ -216,5 +219,4 @@ task copyDownloadableDepsToLibs(type: Copy) {
216219
into 'libs'
217220
}
218221

219-
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
220222
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/app/src/debug/AndroidManifest.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
66

7-
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
7+
<application
8+
android:usesCleartextTraffic="true"
9+
tools:targetApi="28"
10+
tools:ignore="GoogleAppIndexingWarning">
11+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
12+
</application>
813
</manifest>

android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@
2121
<category android:name="android.intent.category.LAUNCHER" />
2222
</intent-filter>
2323
</activity>
24-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
2524
</application>
26-
2725
</manifest>

android/app/src/main/java/com/reactnativeboilerplate/MainActivity.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ public class MainActivity extends ReactActivity {
99
* rendering of the component.
1010
*/
1111

12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(null);
15+
}
1216

13-
@Override
14-
protected void onCreate(Bundle savedInstanceState) {
15-
super.onCreate(null);
16-
}
17-
1817
@Override
1918
protected String getMainComponentName() {
20-
return "reactNativeBoilerplate";
19+
return "reactnativeboilerplate";
2120
}
2221
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">reactNativeBoilerplate</string>
2+
<string name="app_name">reactnativeboilerplate</string>
33
</resources>

android/app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
55
<!-- Customize your theme here. -->
66
<item name="android:textColor">#000000</item>
77
</style>

android/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = "29.0.2"
6-
minSdkVersion = 16
5+
buildToolsVersion = "29.0.3"
6+
minSdkVersion = 21
77
compileSdkVersion = 29
88
targetSdkVersion = 29
9+
ndkVersion = "20.1.5948944"
910
}
1011
repositories {
1112
google()
1213
jcenter()
1314
}
1415
dependencies {
15-
classpath("com.android.tools.build:gradle:3.5.3")
16+
classpath("com.android.tools.build:gradle:4.1.0")
1617
// NOTE: Do not place your application dependencies here; they belong
1718
// in the individual module build.gradle files
1819
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ android.useAndroidX=true
2525
android.enableJetifier=true
2626

2727
# Version of flipper SDK to use with React Native
28-
FLIPPER_VERSION=0.54.0
28+
FLIPPER_VERSION=0.75.1
508 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

android/gradlew

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

android/gradlew.bat

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4040

4141
set JAVA_EXE=java.exe
4242
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4444

4545
echo.
4646
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -54,7 +54,7 @@ goto fail
5454
set JAVA_HOME=%JAVA_HOME:"=%
5555
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5656

57-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5858

5959
echo.
6060
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -64,28 +64,14 @@ echo location of your Java installation.
6464

6565
goto fail
6666

67-
:init
68-
@rem Get command-line arguments, handling Windows variants
69-
70-
if not "%OS%" == "Windows_NT" goto win9xME_args
71-
72-
:win9xME_args
73-
@rem Slurp the command line arguments.
74-
set CMD_LINE_ARGS=
75-
set _SKIP=2
76-
77-
:win9xME_args_slurp
78-
if "x%~1" == "x" goto execute
79-
80-
set CMD_LINE_ARGS=%*
81-
8267
:execute
8368
@rem Setup the command line
8469

8570
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8671

72+
8773
@rem Execute Gradle
88-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8975

9076
:end
9177
@rem End local scope for the variables with windows NT shell

android/settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
rootProject.name = 'reactNativeBoilerplate'
1+
rootProject.name = 'reactnativeboilerplate'
22
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
33
include ':app'

app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"name": "reactNativeBoilerplate",
3-
"displayName": "reactNativeBoilerplate"
2+
"name": "reactnativeboilerplate",
3+
"displayName": "reactnativeboilerplate"
44
}

ios/Podfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,27 @@ require_relative '../node_modules/@react-native-community/cli-platform-ios/nativ
33

44
platform :ios, '10.0'
55

6-
target 'reactNativeBoilerplate' do
6+
target 'reactnativeboilerplate' do
77
config = use_native_modules!
88

9-
use_react_native!(:path => config["reactNativePath"])
9+
use_react_native!(
10+
:path => config[:reactNativePath],
11+
# to enable hermes on iOS, change `false` to `true` and then install pods
12+
:hermes_enabled => false
13+
)
1014

11-
target 'reactNativeBoilerplateTests' do
15+
target 'reactnativeboilerplateTests' do
1216
inherit! :complete
1317
# Pods for testing
1418
end
1519

1620
# Enables Flipper.
1721
#
1822
# Note that if you have use_frameworks! enabled, Flipper will not work and
19-
# you should disable these next few lines.
20-
use_flipper!
21-
post_install do |installer|
22-
flipper_post_install(installer)
23-
end
24-
end
25-
26-
target 'reactNativeBoilerplate-tvOS' do
27-
# Pods for reactNativeBoilerplate-tvOS
23+
# you should disable the next line.
24+
use_flipper!()
2825

29-
target 'reactNativeBoilerplate-tvOSTests' do
30-
inherit! :search_paths
31-
# Pods for testing
26+
post_install do |installer|
27+
react_native_post_install(installer)
3228
end
33-
end
29+
end

0 commit comments

Comments
 (0)