@monobeginner wrote:
Hello,
I would like to reduce apk size with Proguard and linking. I enabled Proguard just with few extra rules
# General Android -dontwarn org.apache.http.** -dontwarn android.net.http.AndroidHttpClient -keep public class com.google.android.gms.* { public *; } -dontwarn com.google.android.gms.**
I also enabled Linking to Sdk Assemblies Only and it works like a charm. When I tried to be more aggresive with reducing apk, I changed Linking to Sdk and User Assemblies. It significantly reduced apk size but now game crashes with exception:
AndroidRuntime android.runtime.JavaProxyThrowable: Microsoft.Xna.Framework.Content.ContentLoadException: Could not load countriesDecoder asset as a non-content file! ---> Microsoft.Xna.Framework.Content.ContentLoadException: Could not find ContentTypeReader Type. Please ensure the name of the Assembly that contains the Type matches the assembly in the full type name: Microsoft.Xna.Framework.Content.ReflectiveReader`1[...] at Microsoft.Xna.Framework.Content.ContentTypeReaderManager.LoadAssetReaders (Microsoft.Xna.Framework.Content.ContentReader reader) [0x00223] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 at Microsoft.Xna.Framework.Content.ContentReader.InitializeTypeReaders () [0x0000b] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 at Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[T] () [0x00000] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T] (System.String assetName, System.Action`1[T] recordDisposableObject) [0x00083] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 --- End of inner exception stack trace --- at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T] (System.String assetName, System.Action`1[T] recordDisposableObject) [0x00104] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 at Microsoft.Xna.Framework.Content.ContentManager.Load[T] (System.String assetName) [0x0005a] in <e1bc6c4bba77484cb5c5e3d8d8976b97>:0 ...
Generally, it has problem with loading any of assets. I decompiled generated apk at it looks that proper Assets/Content folder is attached. I will appriciate any help from you, cause I'm not experienced with this scope of Xamarin / Monogame.
Posts: 1
Participants: 1