Once again it’s me and my admob extension having problems with the build process.
I’ve updated google play services and other related libs in the extension to the current versions and Defold fails to build it because of conflicting resources.
Failed building Android resources to R.java: /var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/bob_bundle_tmp2404027679367473102/res/values/values.xml:70: error: Attribute "fontProviderFetchStrategy" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/4101015115134236277/res/com.android.support.support-compat-27.1.1/values/values.xml:9: Original attribute defined here.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/bob_bundle_tmp2404027679367473102/res/values/values.xml:85: error: Attribute "fontProviderFetchTimeout" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/4101015115134236277/res/com.android.support.support-compat-27.1.1/values/values.xml:14: Original attribute defined here.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/bob_bundle_tmp2404027679367473102/res/values/values.xml:95: error: Attribute "fontStyle" already defined with incompatible format.
/var/folders/hz/pn_wgvvs5gs9t_2zkchyd0w80000gn/T/4101015115134236277/res/com.android.support.support-compat-27.1.1/values/values.xml:17: Original attribute defined here.
The problem is with the support-compat library, more specifically it’s resources.
I already have
in my appmanifest, what do I need to add here to exclude support-compat jar and resources? I’ve tried excluding everything with “(.*).jar”, didn’t seem to work either.
If my understanding of bob.jar is correct, than everything inside bob.jar/lib/android-res.zip gets copied into APK without any exclude rules, am I correct?
We plan to break up the Android build so that Google Play Services is in a separate extension. And move push to a native extension. This will make it easier to reason about and solve issues such as the one you’ve encountered. Until this is done I think maybe @sven and @AGulev may have some ideas?
With the release of our facebook extension, we added some new mechanics in order to make it all work. And in old tradition, our documentation hasn’t caught up yet.
Here’s an example of the ext.manifest using one of the common android keywords.
aaptExtraPackages - extra package name that shoukld be generated
aaptExcludePackages - Regexp (or exact names) of packages to exclude
aaptExcludeResourceDirs - Regexp (or exact names) of resource dirs to exclude
The package names bob.jar currently adds automatically:
com.google.android.gms
com.google.android.gms.common
The resource dirs that bob.jar currently adds automatically
A new day, a new error. Thanks for the explained syntax, got further now.
Now I am getting
Failed building Android resources to R.java: ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:fontVariationSettings
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:ttcIndex
Two errors about attributes fontVariationSettings and ttcIndex.
But if we take a look at res/values/values.xmlhttps://pastebin.com/yYSWU60y you can see that there are specified these attributes (line 121).
Now if I go ahead and comment out both of them I get next cryptic error:
warning: [options] bootstrap class path not set in conjunction with -source 1.6
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
at com.android.dx.command.dexer.Main.run(Main.java:275)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
... 4 more
Huh, that seems really weird.
I mean, if it does find the key, why is it complaining about it…
As for the cryptic message, I don’t really know either
I’ll have to think a little bit so see if I can figure out a reason.
UNfortunately I don’t have time to look into that until next week (beta release day today, and we’re on holiday tomorrow)
Ah, yes. That would explain it.
I can take a look at the code to see if I can fix it.
We also have a ticket for moving com.google.android.gms.** to an extension, to make it even easier to reason about.
New info. I’ve reorganized the res folder into several subfolders and now Defold manges to build an APK on macOS. Still errors on Windows, but with a different error, about missing Theme.IAPTheme.