0

I've built an app that successfully runs on all sorts of Android devices. It was compiled for Android 8, but the device it's running on is Android 9.

Every time I open it on this Huawei P20 Pro, I get a crash. The only sensible error I can see is:

No implementation found for android.content.Context md5c497ac42f3138c67aed930c79af470d4.MainApplication.n_getApplicationContext() (tried Java_md5c497ac42f3138c67aed930c79af470d4_MainApplication_n_1getApplicationContext and Java_md5c497ac42f3138c67aed930c79af470d4_MainApplication_n_1getApplicationContext__)

I never call the get Application Context at any point, so I'm really not sure what is going on here.

Any helpful tips on debugging an issue like this?

Ross Vernal
  • 483
  • 1
  • 5
  • 20

2 Answers2

1

If you compiled it with SDK 27 as max API (version 8) why would you run it on SDK 28, Compile with max version available 28 or 29 and then try running

In manifest make it android:targetSdkVersion="28" and compile using latest enter image description here

Morse
  • 8,258
  • 7
  • 39
  • 64
  • That's a good question! It was compiled with SDK 27 before SDK 28 became widely available. I know from my logs that this does work on other devices. I'm in the process of upgrading anyway, so I will see if that solves the problem. However, I'd rather know specifically why that failure occurs. – Ross Vernal Oct 21 '19 at 09:05
0

First of all, I believe that the issue lacks enough details to make any assumptions about the possible causes. One of the possible causes is setting the target SDK version incorrectly. You can attempt to set to a correct one for the app as Ross Vernal suggested. It may can solve your problem.

Based on what I read from the official Android documents about the targetSdkVersion property, setting the version lower than the API level of a mobile device means that some additional compatibility behavior may be required when the app runs. But this does not mean that the app cannot run on the devices with higher API levels. Whether the compatibility behavior is required depends on the app itself. Therefore, it's possible that a feature or something else that you have decided to use in your app caused the issue on the device.

Additionally, I tested these conditions on my Huawei device that runs on Android 9 (SDK 28) with a sample Xamarin.Forms app under a target SDK of 27. The app launched successfully. This supports the possibility mentioned above.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108