Forum Xamarin.Android

Xamarin.Google.Android.Places (android 9) stop working after switch to d8/r8 and androidx migration.

LeeNetLeeNet USMember ✭✭

I recently upgraded my xamarin android solution to android x along with (d8/r8) compiler/shrinker and now autocomplete is not working. The error is "Can't load search results. Try again". Can someone help me? Am I missing a linker of some sort?

 var intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.Overlay, places)
            .SetCountry("US")
            .SetLocationRestriction(locationBias)
            .Build(this);

        StartActivityForResult(intent, AutocompleteRequestCode);
Tagged:

Best Answer

  • LeeNetLeeNet USMember ✭✭
    Accepted Answer

    @jezh thanks for your assistance. I ended up using d8/proguard and the autocomplete works now. It could be a matter of r8 shrinker not playing nice with google places nugget package.

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    Your previous app worked fine, didn't it?

    The error is "Can't load search results.

    Could you please add a diagnostic build output about this issue?(As a file attachment or gist link).
    Just as the follows.

    1.Help->Xamarin->Zip Logs
    2.Tools ->Options

  • LeeNetLeeNet USMember ✭✭

    @jezh Yes the previous app work fine. I migrated app to android along with d8/r8. I attached 3 files for your review.

    Nuget Package: [dot]nuget[dot]org/packages/Xamarin[dot]Google[dot]Android[dot]Places

    05-27 06:52:45.642 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
    05-27 06:52:45.642 W/tion.linqrs.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
    05-27 06:52:45.642 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
    05-27 06:52:45.645 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)
    05-27 06:52:45.648 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)
    05-27 06:52:45.648 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)
    05-27 06:52:45.648 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)
    05-27 06:52:45.648 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)
    05-27 06:52:45.650 W/tion.x.ap( 8085): Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)
    05-27 06:52:45.651 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)
    05-27 06:52:45.656 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
    05-27 06:52:45.656 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)
    05-27 06:52:45.656 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
    05-27 06:52:45.675 W/tion.x.ap( 8085): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)
    05-27 06:52:45.676 E/Places ( 8085): Error while autocompleting: ERROR

  • jezhjezh Member, Xamarin Team Xamurai

    And if it is convenient for you ,could you please post a basic demo so that we can test on our side?

  • LeeNetLeeNet USMember ✭✭
    Accepted Answer

    @jezh thanks for your assistance. I ended up using d8/proguard and the autocomplete works now. It could be a matter of r8 shrinker not playing nice with google places nugget package.

  • jezhjezh Member, Xamarin Team Xamurai
    edited June 2020

    Congrats, could you please mark your your reply as an answer so that others who have similar question will get help from here?
    Thanks in advance.

Sign In or Register to comment.