|
88 | 88 |
|
89 | 89 | ### Updating from an earlier version |
90 | 90 |
|
91 | | -As of version 2.0.0, the native Branch SDKs are included in the module and must not be installed |
92 | | -from elsewhere (CocoaPods, Carthage or manually). When updating from an earlier |
93 | | -version of `react-native-branch`, you must remove the Branch SDK that was |
94 | | -previously taken from elsewhere. |
| 91 | +To fix a longstanding build issue with Android, it is necessary to take the |
| 92 | +native Branch Android SDK from Maven rather than from the react-native-branch |
| 93 | +module, starting with version 3.0.0. |
95 | 94 |
|
96 | | -#### Android |
| 95 | +Open the `android/app/build.gradle` file in your project. |
97 | 96 |
|
98 | | -Open the `android/app/build.gradle` file |
99 | | -in your project. Remove: |
| 97 | +Remove this line: |
100 | 98 |
|
101 | 99 | ```gradle |
102 | | -compile 'io.branch.sdk.android:library:2.+' |
| 100 | +implementation fileTree(dir: 'libs', include: ['*.jar']) |
103 | 101 | ``` |
104 | 102 |
|
105 | | -And add this line if not already present: |
| 103 | +Add this line: |
106 | 104 |
|
107 | 105 | ```gradle |
108 | | -compile fileTree(dir: 'libs', include: ['*.jar']) |
| 106 | +implementation "io.branch.sdk.android:library:3.0.4" |
109 | 107 | ``` |
110 | 108 |
|
111 | 109 | The result should be something like |
112 | 110 | ```gradle |
113 | 111 | dependencies { |
114 | | - compile project(':react-native-branch') |
115 | | - compile fileTree(dir: 'libs', include: ['*.jar']) |
116 | | - compile "com.android.support:appcompat-v7:23.0.1" |
117 | | - compile "com.facebook.react:react-native:+" // From node_modules |
| 112 | + implementation project(':react-native-branch') |
| 113 | + implementation "io.branch.sdk.android:library:3.0.4" |
| 114 | + implementation "com.android.support:appcompat-v7:23.0.1" |
| 115 | + implementation "com.facebook.react:react-native:+" // From node_modules |
118 | 116 | } |
119 | 117 | ``` |
120 | 118 |
|
121 | | -#### iOS |
122 | | - |
123 | | -Remove the external Branch SDK from your project depending on how you originally |
124 | | -integrated it. |
125 | | - |
126 | | -##### CocoaPods |
127 | | - |
128 | | -###### Apps built using react-native link |
129 | | - |
130 | | -Remove "Branch" from your Podfile. Run `pod install` after updating the Podfile. This is |
131 | | -necessary to regenerate the Pods project without the Branch pod. |
132 | | - |
133 | | -If you added CocoaPods to your project just for the Branch pod, you can remove CocoaPods entirely from your app using the [pod deintegrate](https://guides.cocoapods.org/terminal/commands.html#pod_deintegrate) command. |
134 | | - |
135 | | -###### Using the React pod |
136 | | - |
137 | | -Replace `pod "Branch"` in your Podfile with `pod "Branch-SDK", path: "../node_modules/react-native-branch/ios"`. |
138 | | -```Ruby |
139 | | -pod "React", path: "../node_modules/react-native" |
140 | | -# The following line is necessary with use_frameworks! or RN >= 0.42. |
141 | | -pod "Yoga", path: "../node_modules/react-native/ReactCommon/yoga" |
142 | | -pod "react-native-branch", path: "../node_modules/react-native-branch" |
143 | | -pod "Branch-SDK", path: "../node_modules/react-native-branch/ios" |
144 | | -``` |
145 | | - |
146 | | -The location of `node_modules` relative to your `Podfile` may vary. |
147 | | - |
148 | | -Run `pod install` after making this change. |
149 | | - |
150 | | -##### Carthage |
151 | | - |
152 | | -Remove Branch.framework from your app's dependencies. Also remove Branch.framework from your `carthage copy-frameworks` build phase. |
153 | | -
|
154 | | -##### Manually installed |
155 | | -
|
156 | | -Remove Branch.framework from your app's dependencies. |
| 119 | +If you're using an older version of Gradle, you may need `compile` instead of |
| 120 | +`implementation`. |
157 | 121 |
|
158 | 122 | ___ |
159 | 123 |
|
|
0 commit comments