Skip to content

Commit

Permalink
fix: added android multidexing for all branch required frameworks
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanneff committed Jul 11, 2017
1 parent 92bfefe commit edc5480
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
18 changes: 17 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
android {
defaultConfig {
multiDexEnabled true
}
}

dependencies {
// multidex for frameworks
compile 'com.android.support:multidex:1.0.1'
// branch sdk
compile 'io.branch.sdk.android:library:2+'
// branch app indexing
compile 'com.google.android.gms:play-services-appindexing:9.+'
// branch chrome tabs for better matching
compile 'com.android.support:customtabs:23.3.0'
compile 'com.android.support:customtabs:23.3.0'
// branch gaid for better device matching
compile 'com.google.android.gms:play-services-ads:9+'
}
2 changes: 1 addition & 1 deletion plugin.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SOFTWARE.
</config-file>

<source-file src="src/android/io/branch/BranchSDK.java" target-dir="src/io/branch" />
<framework src="io.branch.sdk.android:library:2+" />
<framework src="build.gradle" custom="true" type="gradleReference" />
</platform>

<!-- iOS -->
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ SOFTWARE.
</config-file>

<source-file src="src/android/io/branch/BranchSDK.java" target-dir="src/io/branch" />
<framework src="io.branch.sdk.android:library:2+" />
<framework src="build.gradle" custom="true" type="gradleReference" />
</platform>

<!-- iOS -->
Expand Down
9 changes: 9 additions & 0 deletions src/scripts/android/updateAndroidManifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
var mainActivityIndex = getMainLaunchActivityIndex(manifest['manifest']['application'][0]['activity'])

// update manifest
manifest = updateMultidex(manifest)
manifest = updateBranchMetaData(manifest, preferences)
manifest = updateBranchReferrerTracking(manifest)
manifest = updateLaunchOptionToSingleTask(manifest, mainActivityIndex, preferences)
Expand Down Expand Up @@ -56,6 +57,14 @@
return manifest
}

// adds to <application> for multidex (needed for all the frameworks)
// <application android:name="android.support.multidex.MultiDexApplication" >
// </application>
function updateMultidex (manifest) {
manifest['manifest']['application'][0]['$']['android:name'] = 'android.support.multidex.MultiDexApplication'
return manifest
}

// adds to <application> for install referrer tracking (optional)
// <receiver android:name="io.branch.referral.InstallListener" android:exported="true">
// <intent-filter>
Expand Down

0 comments on commit edc5480

Please sign in to comment.