I'm making a very simple mobile F2P arcade game in Unity After adding SDKs for facebook, gamesparks, firebase, and appodeal I coud not build, getting the "Too many method references: 76221; max is 65536" error.
The solution from Too many field references: 70613; max is 65536 is apparently to export an ADT project, import it into Android studio and go from there.
I built following these instructions, and after building my Android studio project had errors relating to the facebook SDK similar to here: Unity exporting android project with Facebook SDK issue
The solution proposed there is to copy all the .aar
from your Unity project to files to the Android studio project and add lines to the build.gradle file referencing them, which I did.
After doing all that the 4 facebook related errors are gone but one new one appears:
Error: more than one library with package name 'android.support.v7.appcompat
A proposed solution for that is to search for the offending file and delete it in windows explorer but there is nothing with that name in my Android studio project folder. I tried removing some .aar
files with appcompat in the name but I ended up reverting to the previous 4 facebook errors
It seems I can either have the 4 facebook errors or the 'more than one library' error.
Here is what my build.gradle file looks like..
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.ARTEFICER.fruitfall"
minSdkVersion 16
targetSdkVersion 25
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile(name: 'animated-vector-drawable-23.4.0', ext: 'aar')
compile(name: 'appcompat-v7-23.4.0', ext: 'aar')
compile(name: 'cardview-v7-23.4.0', ext: 'aar')
compile(name: 'customtabs-23.4.0', ext: 'aar')
compile(name: 'facebook-android-sdk-4.17.0', ext: 'aar')
compile(name: 'facebook-android-wrapper-7.9.4', ext: 'aar')
compile(name: 'firebase-app-unity-3.0.3', ext: 'aar')
compile(name: 'firebase-common-10.2.6', ext: 'aar')
compile(name: 'firebase-iid-10.2.6', ext: 'aar')
compile(name: 'firebase-messaging-10.2.6', ext: 'aar')
compile(name: 'firebase-messaging-unity-3.0.3', ext: 'aar')
compile(name: 'play-services-ads-10.2.6', ext: 'aar')
compile(name: 'play-services-ads-lite-10.2.6', ext: 'aar')
compile(name: 'play-services-base-10.2.6', ext: 'aar')
compile(name: 'play-services-basement-10.2.6', ext: 'aar')
compile(name: 'play-services-clearcut-10.2.6', ext: 'aar')
compile(name: 'play-services-gass-10.2.6', ext: 'aar')
compile(name: 'play-services-location-10.2.6', ext: 'aar')
compile(name: 'play-services-tasks-10.2.6', ext: 'aar')
compile(name: 'support-compat-25.2.0', ext: 'aar')
compile(name: 'support-core-ui-25.2.0', ext: 'aar')
compile(name: 'support-core-utils-25.2.0', ext: 'aar')
compile(name: 'support-fragment-25.2.0', ext: 'aar')
compile(name: 'support-media-compat-25.2.0', ext: 'aar')
compile(name: 'support-v4-25.2.0', ext: 'aar')
compile(name: 'support-vector-drawable-23.4.0', ext: 'aar')
compile project(':animatedvectordrawable2340')
compile project(':cardviewv72340')
compile project(':cheetahmobile')
compile project(':customtabs2340')
compile project(':facebookandroidsdk4170')
compile project(':facebookandroidwrapper794')
compile project(':firebase')
compile project(':firebaseappunity303')
compile project(':firebasecommon1026')
compile project(':firebaseiid1026')
compile project(':firebasemessaging1026')
compile project(':firebasemessagingunity303')
compile project(':playservicesads1026')
compile project(':playservicesadslite1026')
compile project(':playservicesbase1026')
compile project(':playservicesclearcut1026')
compile project(':playservicesgass1026')
compile project(':playserviceslocation1026')
compile project(':playservicestasks1026')
compile project(':supportcompat2520')
compile project(':supportcoreui2520')
compile project(':supportcoreutils2520')
compile project(':supportfragment2520')
compile project(':supportmediacompat2520')
compile project(':supportv42520')
compile project(':supportvectordrawable2340')
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:25.3.1'
compile files('libs/applovin-6.3.0.jar')
compile files('libs/appodeal-1.15.9.jar')
compile files('libs/bolts-android-1.4.0.jar')
compile files('libs/bolts-applinks-1.4.0.jar')
compile files('libs/bolts-tasks-1.4.0.jar')
compile files('libs/chartboost-6.6.1.jar')
compile files('libs/flurry-analytics-6.5.0.jar')
compile files('libs/libmessaging_unity_player_activity.jar')
compile files('libs/my-target-4.5.10.jar')
compile files('libs/support-annotations-25.2.0.jar')
compile files('libs/unity-ads-2.0.4.jar')
compile files('libs/unity-classes.jar')
compile files('libs/yandex-metrica-2.62.jar')
}
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
}
}
I've tried commenting out these lines.
compile 'com.android.support:appcompat-v7:25.3.1'
compile project(':supportcompat2520')
compile(name: 'support-compat-25.2.0', ext: 'aar')
But I still have that one 'more than one library with package name' error
Also please note I am a Unity dev. I have never opened Android Studio until a few days ago, so you will certainly need to dumb things down as much as possible!