AAPT.exe crashes, when trying to support APIs older than 12 - android

What might be the probable cause for the "AAPT.exe has stopped working" error, when it only appears after changing minSdkVersion to something lower than 12?
I had started developing an application, which was targeting API 18 and I decided to support older versions, too. There is nothing useful to update in the Android SDK Manager nor in the Eclipse-plugins. Eclipse isn't giving me any hints about what might be wrong. Naturally, I have tried cleaning the project, but it always ends in showing that error.

Related

Xamarin Forms App crashing on Huawei P20 Pro

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?
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
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.

Dealing with Android SDK versions and Targeting

So we are working with Xamarin and it seems that after we upgraded our Android project it seemed to change the Target SDK of our app from 21 to 25. We never noticed this and uploaded an .apk into Alpha Testing.
I later noticed this issue, tried to revert to v21 target and now Google is telling me it cannot because of a breaking permission change in v23 (Marshmallow).
I tried disabling the alpha testing and deleting the v25 target, but that did not work.
I did notice that I could at least downgrade to v23 Marshmallow and carry on with my app release.
BUT: According to usage stats I've looked into I'm cutting off support for appx 15 - 25% of devices (take your pick) by only supporting Marshmallow+...
I've done some research around the issue and haven't found a way to solve it yet. I also emailed Google Support in hopes they can help.
Can anyone shed some light on this?
Thanks!!!
#MoGa suggestion was the correct one. Target v23 and set Minimum SDK to 21. This worked very well, and allows me to continue to target all the devices we need to.

How do i resolve this error "Installation failed with message INSTALL_FAILED_OLDER_SDK"?

Ok, so i have been using eclipse for my android development but then i noticed that the eclipse IDE gave me a lot of errors and i researched online and found that Android Studio was worth a shot. So, i downloaded android studio yesterday and then created a test application. The Target SDK was 15 and i was using Android 2.0 Froyo to test my application since it loads faster. Now, when i run my app, i get that annoying message and i have no clue how to fix it. Please guide me through the steps of fixing it. Thanks a lot
The minSdkVersion in your project -- whether from your code or from a library -- is higher than the API level of the device or emulator on which you are trying to run your app. Either:
Adjust your minSdkVersion, or
Use a device or emulator that is capable of running Android at the level specified by your minSdkVersion

Android target SDK version and phones

So I wrote an Android app a while ago, and I'm trying to update it. I'm wanting to build in code sections where if the phone they're on is less than 3.0, do something one way, otherwise do it another way.
My build target is set to 11 in the project.properties file, but it still seems to run on Android versions < 3.0? Is this normal? Will I see some crash at some point? Everything seems to be working... My minSDKVersion is 8, but happens when I run this app with Android 3.0 code on Android 2.3.3?
It will in general run OK on platforms as far back as API level 8, since that's what you have as your minSdkVersion. It will, however, crash on earlier (pre-11) platforms if you try to call any APIs which were introduced at level 11 or later. To avoid this, you should check the OS version at runtime before calling any such methods. See Retrieving Android API version programmatically for advice on how to do this.
It is usually best to work from lower APIs up when approaching this kind of development. Each time you've finished a working version for an API, make sure it compiles without error before moving up to the next level. The manifest will warn you if you're targetSdkVersion and your minSdkVersion are different; however, this is mostly just to make sure that you are careful not to call methods from higher APIs. A useful work around might be:
private static int getApiLevel() {
return Integer.parseInt(android.os.Build.VERSION.SDK);
}
I think I was having a dumb moment.
If I set my minSDK to 8, then anything newer than 8 should work fine.
If I set my build target to 11, and then do checks before running any code that is newer than 8 on phones with SDKs older than 11, then that should cover all the bases.
I just got a little confused when I was messing with the targetSDK and the minSDK
Thanks for the comments.

Eclipse doesnt seem to like my sdkversion requirements

I have in my manifest:
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="13"/>
I want to allow 2.2 to run my app but i have to have targetsdkversion 13 for admob to work. But eclipse is saying: " Attribute minSdkVersion (8) is lower than the project target API level (13)" and wont even show the avd's for anything below 3.2... but that didn't happen until just a little while ago. I didnt change anything there. whats happening? i've tried to clean it but that didnt help.
It's just be a warning. If you run your app, it should run on any devices from SDK version 8 to 13. Are you not able to generate the apks, and run it?
I used to see the warning in the older version of eclipse and the ADT, but since moving to Indigo and the newer android plug in I no longer get that, it was just annoying but did not cause any other issues.

Categories

Resources