Xamarin.Forms Migration From Android 11 to Android 12

Alessio Camaroto 81 Reputation points
2022-12-12T22:49:41.437+00:00

I'm trying to publish my new version app on Google Play but the process failed because I have to upgrade Target API Version to version 30. I update API version but now my app doesn't startup:

Android application is running (debug is disabled in android project properties).
Start debugging Android application ...

am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.kamax.specialitaegagesci/crc649f72c58789122579.SplashActivity"
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.kamax.specialitaegagesci/crc649f72c58789122579.SplashActivity }

I add to SplashActivity decorators Exported = true but it doesn't work. What I have to do to migrate from Android 11 to Android 12 ? Which are the steps to follow ?

Thanks
Alessio

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Graham McKechnie 316 Reputation points
    2022-12-19T21:13:09.64+00:00

    See the following link for how to add a splash screen for Android 12 and 13. https://github.com/gmck/XamarinBasicSplashScreen

    0 comments No comments

  2. Alessio Camaroto 81 Reputation points
    2022-12-19T21:14:13.977+00:00

    Finally I solved the problem after updating Xamarin.GooglePlayServices.Ads package to 121.3.0 version

    0 comments No comments

  3. Graham McKechnie 316 Reputation points
    2022-12-20T00:07:39.813+00:00

    Your fix doesn't make much sense considering your initial message suggested that you had a problem with the SplashActivity, which is not allowed as a separate Activity in an Android 12 application. Have you checked that the app now displays the splash screen correctly on all devices e.g Android 12 and lower?

    0 comments No comments

  4. Alessio Camaroto 81 Reputation points
    2022-12-20T06:47:03.863+00:00

    It works perfectly. I put Exported = true decoration in my two activity (SplashScreenActivity, MainActivity) and update Xamarin.GooglePlayServices.Ads package to 121.3.0 version. That's it.


  5. omar abdelsalm 0 Reputation points
    2023-01-19T19:12:16.1933333+00:00

    try this

    [https://github.com/xamarin/xamarin-android/wiki/JDK-11-Warning#install-platform

    0 comments No comments