Edition : Windows 10 Pro Version : 1709 OS Build : 16299.192
2017.3.0f3 Personal
GooglePlayGamesPlugin-0.9.50.unitypackage
facebook-unity-sdk-7.11.0.unitypackage
https://stackoverflow.com/questions/42582850/too-many-field-references-70613-max-is-65536
by Programmer
by Ugurcan Yildirim
https://answers.unity.com/questions/1397172/gradle-build-errors.html
by nanotribegmbh
[File] -> [Build Settings]
In the [Build Settings] dialogue
- make sure you [Switch Platform]ed to [Android]
- change [Build System] from [Internal] (most cases) to [Gradle]
let Unity do the rest job if it has some.
Copy
<UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Apk\AndroidManifest.xml
to
<ProjectName>Assets\Plugins\Android\
Edit AndroidManifest.xml you just copied
Add
android:name="android.support.multidex.MultiDexApplication"
to the [application] tag.
Copy
<UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates\mainTemplate.gradle
to
<ProjectName>Assets\Plugins\Android\
Make sure that in Unity
[Edit] -> [Project Settings] -> [Player] -> [Android Robot Tab] -> [Publishing Settings] -> [Build]
- [Build System] is set to [Gradle]
- [Custom Gradle Template] is checked and the file path is the one you just copied
Add
compile 'com.android.support:multidex:1.0.1'
to the [dependencies] block.
Add
multiDexEnabled true
to the [android] -> [defaultConfig] block.
Build and see if it works for you.
Continue with the last step
Remove
useProguard **PROGUARD_DEBUG**
from the [android] -> [buildTypes] -> [debug] block.
Remove
useProguard **PROGUARD_RELEASE**
from the [android] -> [buildTypes] -> [release] block.
Build and see if it works for you.
In Unity, [Edit] -> [Project Settings] -> [Player] -> [Android Robot Tab] -> [Publishing Settings] -> [Build]
check [User Proguard File]
Edit the generated proguard file
Add
-dontwarn whatever.is.listed.in.the.warnings
Build and see if it works for you.