Browse Source

format installation-android doc

Guy Carmeli 6 years ago
parent
commit
48e1788e45
1 changed files with 62 additions and 58 deletions
  1. 62
    58
      docs/docs/installation-android.md

+ 62
- 58
docs/docs/installation-android.md View File

@@ -18,71 +18,73 @@
18 18
 	
19 19
 3. Update `android/build.gradle`
20 20
 
21
-```diff
22
-buildscript {
23
-    repositories {
24
-+        mavenLocal()
25
-+        mavenCentral()
26
-+        google()
27
-+        jcenter()
28
-    }
29
-    dependencies {
30
-+        classpath 'com.android.tools.build:gradle:3.0.1'
31
--        classpath 'com.android.tools.build:gradle:2.2.3'
32
-    }
33
-}
34
-
35
-allprojects {
36
-    repositories {
37
-        mavenLocal()
38
-+        mavenCentral()
39
-+        google()
40
-        jcenter()
41
-        maven {
42
-            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
43
-            url "$rootDir/../../node_modules/react-native/android"
44
-        }
45
-    }
46
-}
47
-```
21
+	```diff
22
+	buildscript {
23
+	    repositories {
24
+	+        mavenLocal()
25
+	+        mavenCentral()
26
+	+        google()
27
+	+        jcenter()
28
+	    }
29
+	    dependencies {
30
+	+        classpath 'com.android.tools.build:gradle:3.0.1'
31
+	-        classpath 'com.android.tools.build:gradle:2.2.3'
32
+	    }
33
+	}
34
+	
35
+	allprojects {
36
+	    repositories {
37
+	        mavenLocal()
38
+	+        mavenCentral()
39
+	+        google()
40
+	        jcenter()
41
+	        maven {
42
+	            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
43
+	            url "$rootDir/../../node_modules/react-native/android"
44
+	        }
45
+	    }
46
+	}
47
+	```
48 48
 
49 49
 4. Update project dependencies in `android/app/build.gradle`.
50
-```groovy
51
-android {
52
-    compileSdkVersion 25
53
-    buildToolsVersion "27.0.3"
54
-
55
-    compileOptions {
56
-        sourceCompatibility JavaVersion.VERSION_1_8
57
-        targetCompatibility JavaVersion.VERSION_1_8
58
-    }
59
-    ...
60
-}
61
-
62
-dependencies {
63
-    implementation fileTree(dir: "libs", include: ["*.jar"])
64
-    implementation "com.android.support:appcompat-v7:25.4.0"
65
-    implementation "com.facebook.react:react-native:+"
66
-    implementation project(':react-native-navigation')
67
-}
68
-```
50
+
51
+	```groovy
52
+	android {
53
+	    compileSdkVersion 25
54
+	    buildToolsVersion "27.0.3"
55
+	
56
+	    compileOptions {
57
+	        sourceCompatibility JavaVersion.VERSION_1_8
58
+	        targetCompatibility JavaVersion.VERSION_1_8
59
+	    }
60
+	    ...
61
+	}
62
+	
63
+	dependencies {
64
+	    implementation fileTree(dir: "libs", include: ["*.jar"])
65
+	    implementation "com.android.support:appcompat-v7:25.4.0"
66
+	    implementation "com.facebook.react:react-native:+"
67
+	    implementation project(':react-native-navigation')
68
+	}
69
+	```
69 70
 	
70 71
 5. Make sure you're using the new gradle plugin, edit `android/gradle/wrapper/gradle-wrapper.properties`
71 72
 
72
-```diff
73
-distributionBase=GRADLE_USER_HOME
74
-distributionPath=wrapper/dists
75
-zipStoreBase=GRADLE_USER_HOME
76
-zipStorePath=wrapper/dists
77
-+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
78
--distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
79
-```
73
+	```diff
74
+	distributionBase=GRADLE_USER_HOME
75
+	distributionPath=wrapper/dists
76
+	zipStoreBase=GRADLE_USER_HOME
77
+	zipStorePath=wrapper/dists
78
+	+distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
79
+	-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
80
+	```
80 81
 
81 82
 6. Update `gradle.properties` and disable incremental resource processing
82
-```diff
83
-+# Disable incremental resource processing as it broke relase build
84
-+android.enableAapt2=false
85
-```
83
+
84
+	```diff
85
+	+# Disable incremental resource processing as it broke relase build
86
+	+android.enableAapt2=false
87
+	```
86 88
 
87 89
 7. In `MainActivity.java` it should extend `com.reactnativenavigation.NavigationActivity` instead of `ReactActivity`.
88 90
 
@@ -99,6 +101,7 @@ zipStorePath=wrapper/dists
99 101
 	If you have any **react-native** related methods, you can safely delete them.
100 102
 
101 103
 8. In `MainApplication.java`, add the following
104
+	
102 105
 	```java
103 106
 	import com.reactnativenavigation.NavigationApplication;
104 107
 
@@ -121,6 +124,7 @@ zipStorePath=wrapper/dists
121 124
 	Make sure that `isDebug` methods is implemented.
122 125
 
123 126
 9. Update `AndroidManifest.xml` and set **android:name** value to `.MainApplication`
127
+	
124 128
 	```xml
125 129
 	<application
126 130
 		android:name=".MainApplication"