Commit eddc2b0b by andrewlewis Committed by Oliver Woodman

Enable multidex for demos

This is necessary now we have Guava in debug (no-minified) apps.

Also switch to AndroidX multidex to remove the support library dependency.
Temporarily we need to add an Application class, as internal jetification
doesn't seem to handle declaring MultiDexApplication in AndroidManifest.xml.

issue:#7421
PiperOrigin-RevId: 313145023
parent 1f125425
...@@ -31,6 +31,7 @@ project.ext { ...@@ -31,6 +31,7 @@ project.ext {
androidxAppCompatVersion = '1.1.0' androidxAppCompatVersion = '1.1.0'
androidxCollectionVersion = '1.1.0' androidxCollectionVersion = '1.1.0'
androidxMediaVersion = '1.0.1' androidxMediaVersion = '1.0.1'
androidxMultidexVersion = '2.0.0'
androidxTestCoreVersion = '1.2.0' androidxTestCoreVersion = '1.2.0'
androidxTestJUnitVersion = '1.1.1' androidxTestJUnitVersion = '1.1.1'
androidxTestRunnerVersion = '1.2.0' androidxTestRunnerVersion = '1.2.0'
......
...@@ -27,6 +27,7 @@ android { ...@@ -27,6 +27,7 @@ android {
versionCode project.ext.releaseVersionCode versionCode project.ext.releaseVersionCode
minSdkVersion project.ext.minSdkVersion minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.appTargetSdkVersion targetSdkVersion project.ext.appTargetSdkVersion
multiDexEnabled true
} }
buildTypes { buildTypes {
...@@ -57,6 +58,7 @@ dependencies { ...@@ -57,6 +58,7 @@ dependencies {
implementation project(modulePrefix + 'library-ui') implementation project(modulePrefix + 'library-ui')
implementation project(modulePrefix + 'extension-cast') implementation project(modulePrefix + 'extension-cast')
implementation 'androidx.appcompat:appcompat:' + androidxAppCompatVersion implementation 'androidx.appcompat:appcompat:' + androidxAppCompatVersion
implementation 'androidx.multidex:multidex:' + androidxMultidexVersion
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.1.0'
} }
......
/*
* Copyright 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer2.castdemo;
import androidx.multidex.MultiDexApplication;
// Note: Multidex is enabled in code not AndroidManifest.xml because the internal build system
// doesn't dejetify MultiDexApplication in AndroidManifest.xml.
/** Application for multidex support. */
public final class DemoApplication extends MultiDexApplication {}
...@@ -27,6 +27,7 @@ android { ...@@ -27,6 +27,7 @@ android {
versionCode project.ext.releaseVersionCode versionCode project.ext.releaseVersionCode
minSdkVersion project.ext.minSdkVersion minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.appTargetSdkVersion targetSdkVersion project.ext.appTargetSdkVersion
multiDexEnabled true
} }
buildTypes { buildTypes {
...@@ -64,6 +65,7 @@ android { ...@@ -64,6 +65,7 @@ android {
dependencies { dependencies {
implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion implementation 'androidx.annotation:annotation:' + androidxAnnotationVersion
implementation 'androidx.appcompat:appcompat:' + androidxAppCompatVersion implementation 'androidx.appcompat:appcompat:' + androidxAppCompatVersion
implementation 'androidx.multidex:multidex:' + androidxMultidexVersion
implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.material:material:1.1.0'
implementation project(modulePrefix + 'library-core') implementation project(modulePrefix + 'library-core')
implementation project(modulePrefix + 'library-dash') implementation project(modulePrefix + 'library-dash')
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
*/ */
package com.google.android.exoplayer2.demo; package com.google.android.exoplayer2.demo;
import android.app.Application; import androidx.multidex.MultiDexApplication;
import com.google.android.exoplayer2.DefaultRenderersFactory; import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.RenderersFactory; import com.google.android.exoplayer2.RenderersFactory;
import com.google.android.exoplayer2.database.DatabaseProvider; import com.google.android.exoplayer2.database.DatabaseProvider;
...@@ -40,7 +40,7 @@ import java.io.IOException; ...@@ -40,7 +40,7 @@ import java.io.IOException;
/** /**
* Placeholder application to facilitate overriding Application methods for debugging and testing. * Placeholder application to facilitate overriding Application methods for debugging and testing.
*/ */
public class DemoApplication extends Application { public class DemoApplication extends MultiDexApplication {
public static final String DOWNLOAD_NOTIFICATION_CHANNEL_ID = "download_channel"; public static final String DOWNLOAD_NOTIFICATION_CHANNEL_ID = "download_channel";
......
...@@ -45,9 +45,9 @@ dependencies { ...@@ -45,9 +45,9 @@ dependencies {
implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0' implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion compileOnly 'org.jetbrains.kotlin:kotlin-annotations-jvm:' + kotlinAnnotationsVersion
androidTestImplementation project(modulePrefix + 'testutils') androidTestImplementation project(modulePrefix + 'testutils')
androidTestImplementation 'androidx.multidex:multidex:' + androidxMultidexVersion
androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion androidTestImplementation 'androidx.test:rules:' + androidxTestRulesVersion
androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion androidTestImplementation 'androidx.test:runner:' + androidxTestRunnerVersion
androidTestImplementation 'com.android.support:multidex:1.0.3'
androidTestCompileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion androidTestCompileOnly 'org.checkerframework:checker-qual:' + checkerframeworkVersion
testImplementation project(modulePrefix + 'testutils') testImplementation project(modulePrefix + 'testutils')
testImplementation 'com.google.guava:guava:' + guavaVersion testImplementation 'com.google.guava:guava:' + guavaVersion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment