0

today we will upload the app to playstore, but playstore has a minimum requirement of targetSdkVersion 30. Meanwhile we have targetSdkVersion 26. We have to change to 30. When we change the targetSdkVersion in gradle, our app can't access the server and dil logcat has caption "RecyclerView: No adapter attached; skipping layout". How to overcome this?

TargetSdkVersion 26

Application runs fine at targetSdkVersion 26

TargetSdkVersion 30

Application does not run properly at targetSdkVersion 30

1 Answers1

3

Migration process is documented in android developer documentation, for migration from api level 26 to api level 30 look here:

Migrating from lower than Android 10 (API level 29)

For migration from api level 26, you start from :

  1. Migrating from Android 8 (API 26) to Android 9 (API 28)
  2. then "Migrating from Android 9 (API level 28) to Android 10 (API level 29)"
  3. then you can proceed to Migrate from Android 10 (API level 29) to Android 11 (API level 30)

there are lots of information on what have changed in each target sdk bump. You need to look at your code and apply changes as appropriate.

Regarding your particular problem: "RecyclerView: No adapter attached; skipping layout" - its hard to tell without looking into code. This might be problem with delayed setLayoutManager call, or maybe there are other warnings/errors in your logcat that indicate some other problems.

I would suggest to first migrate to api 28, then to 29 and finally to 30. Each time check for any errors in your application.

marcinj
  • 48,511
  • 9
  • 79
  • 100