Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AndroidX MultiDex not found

Tags:

I'm creating a new android project and decided to use the new AndroidX replacement for the support libraries, docs for which can be found here: https://developer.android.com/jetpack/androidx/migrate.

I followed the steps to the letter and after syncing gradle I have access to the androidx namespace and various classes contained within. However, when creating my application class I want to inherit from androidx.multidex.MultiDexApplication (which can be seen in the table in the link above). However, the entire multidex package doesn't exist.

Has anyone resolved this issue? Any pointers?

like image 327
Thomas Cook Avatar asked Nov 16 '18 11:11

Thomas Cook


2 Answers

android.enableJetifier=true does not make the least sense, while being able to replace it.

you can simply add it as a dependency, without non-transparent mangling of name-spaces:

implementation "androidx.multidex:multidex:2.0.1" 
like image 147
Martin Zeitler Avatar answered Oct 27 '22 11:10

Martin Zeitler


If you are using androidx you should add MultiDexApplication(reference from androidx) to your manifest file.

<application         android:name="androidx.multidex.MultiDexApplication"         .....></application> 
like image 27
gokhan Avatar answered Oct 27 '22 09:10

gokhan