You will need to useEclipse IDE in the next steps. So, Please Eclipse IDE for Java Developers should be installed.
You can download it here if you don’t have it installed yet.
Andmore eclipse plugin should be installed to enable multidex support.
Go to Help -> Eclipse Marketplace…
Search for andmore.
Click Install for Andmore : Development Tools for Android.
Restart Eclipse after installation.
Configure Android SDK path.
Move to Eclipse Preferences, click on Android tab and choose path to Android SDK.
Note: Eclipse requires Android SDK with Ant support. Ant was removed from Android SDK in ver. 25 so you need to use Android SDK below version 25. You can download latest Android SDK with Ant support here: MacOS Windows.
Export Unity project
In Unity go to Build Settings… select Android Platform and check Google Android Project. Click Export and choose folder to export (we recommend to export in an empty folder).
Configuring Eclipse project
Import exported projects in Eclipse:
Go to File -> Import... select Existing Android code into Workspace and click Next.
Click Browse, select folder where you have exported Unity project and press Finish.
Configure multidex in Eclipse project:
- Go to Properties of UnityPlayerNativeActivity module.
- Expand Android category and click on General.
- Check Enable MultiDex support.
- Expand UnityPlayerNativeActivity module, open AndroidManifest.xml and add following line to application tag:
- Also you need to implement MultiDex library for supporting Android up to 5.0, you can download following one and import it in the same way Unity Exported Project was imported.
Import Google Play Services & Android Support Libraries:
Appodeal Requires Google Play Services to be imported to your project. You can do it in the following ways:
- (Can cause some issues when importing to Eclipse) Using Google Play Services Resolver:
- Download it here, it includes Dependencies for Appodeal.
- Import to your Unity Project.
- In the Build Settings of Unity Project select Android Platform.
- Go to Assets -> Play Services Resolver -> Android Resolver -> Resolve, it will import and expand all the needed play services modules to your project.
2. (Recommended) Import Eclipse-ready modules to Eclipse project:
- Download it here: GPS, Android Support.
- Unzip it (we recommend to place it under the folder that was used for exporting from Unity).
- Go to File -> Import... select Existing Android code into Workspace and click Next.
- Click Browse, select folder where you have exported Unity project and press Finish.
- Open UnityPlayerNativeActivity properties, move to android category near Libraries section press Add and add all imported support and play services libraries.
3. You can add your own Play Services, but it should be ver. 12.0.0 or higher for Google Play Services and 26.1.0 or higher for Android Support.
Expand UnityPlayerNativeActivity module, open AndroidManifest.xml and add following lines under application tag:
Project ready for Build.