Trying to add MultiDex support - cannot find symbol context and MultiDex

折月煮酒 提交于 2019-12-04 04:09:57
atkayla

Thanks to @Gabe Sechan for the help. I know React Native/JavaScript, kind of clueless about Android/Java, so I simply followed the instructions at https://developer.android.com/studio/build/multidex.html#mdex-gradle, which did not mention any additional imports. I learned to look up the package I needed here: https://developer.android.com/reference/android/support/multidex/MultiDexApplication.html. After adding:

import android.support.multidex.MultiDexApplication;

public class MainApplication extends MultiDexApplication implements ReactApplication {
...

App seems to build and run successfully on Android 4.4.4+ devices. On my Samsung Galaxy S3 simulator running 4.3 however, I am getting a crash upon app start: What does WIN DEATH: android.osDeadObjectException mean?, which seems like another issue altogether.

The reason you are having this "symbol not found" issue is because you haven't imported the required imports. Why not simply add the following imports

import android.support.multidex.MultiDex;

import android.content.Context;

You should know the different cases for using each Multidex option. Kindly refer to https://developer.android.com/studio/build/multidex#java for all information relating to MultiDexing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!