Making Unity IAP Service Works with Android SDK 23 - android

I'm currently working in a project involving adding microtransaction inside our android mobile game. We are using Unity and their easy to implement service system (Unity IAP). Our project need to run with the Android SDK 23 in order to compile with the plugins we're using.
Now since we added the In-App Purchasing service, Unity need to use the Android SDK 24 to build an APK. It's actually showing me an error that it can't merge the AndroidManifest because of this contradiction. One place we need API 23 and another API 24.
Is there a solution ? Is there a way to download or import a Unity IAP compatible with Android SDK 23 ? If so where and how ?
I can't seem to find anything about this.
Thanks for you help

Merely install Android SDK 24 on the build machine and retry with prior settings to fix. Minimum SDK (android:minSdkVersion) for Unity IAP has not changed with v1.11.0, only targetSdkVersion.
The AndroidManifest.xml for GooglePlay now includes a VR extension to help support Daydream purchasing. Buying goods on Daydream, without this extension, will cause uncomfortable flickering for a user. Android SDK 24 includes this new resource definition, and the corresponding dependency hint <uses-sdk android:targetSdkVersion="24"/>, to support a smooth, immersive VR purchasing dialog.
See What is the difference between min SDK version/target SDK version vs. compile SDK version? for more on Target SDK.
See https://forum.unity3d.com/threads/cant-use-iap-on-version-5-5.472094/#post-3079524 for a picture illustrating a shortcut to installing SDK 24, from Unity 5.6 or Unity 2017.1.

I installed Android SDK 24 and change my player settings so the Target API is 24, kept minimal API to the lowest possible. Everything's working fine now the game is building an APK.
Thank you all.

Related

For Google Play, can I have my game require less than Android 12 to download?

I have built a game for Android that I am pretty exited about and proud of. I have released it to the app store but in order to download the game it needs to have Android 12 or above. I know very few people who currently have that new of an Android phone which heavily limits my audience. Is there a way that I can change the game to where it requires less than Android 12? Also the game is built in Unity if that changes anything.
Thank you,
Tyrone McClanahan
Link to game:
https://play.google.com/store/apps/details?id=com.TyMcClanahan.BoomerangBilly
You need to update the minSdkVersion field on the AndroidManifest.xml
See https://developer.android.com/training/basics/supporting-devices/platforms
You can choose the value of minSdkVersion that matches the Android API Level that your app is compatible with.
Make sure not to confuse minSdkVersion and targetSdkVersion. The latter only configures the behaviour of the app and not the eligibility of devices for your app. See What is the difference between min SDK version/target SDK version vs. compile SDK version? for more details.
You can set the Minimum API Level directly in the Unity Player Settings.
https://docs.unity3d.com/Manual/class-PlayerSettingsAndroid.html
With Unity 2021 you can decrease it down to Android 5.1, see https://docs.unity3d.com/Manual/system-requirements.html

Is there a way for publishing an Android App with API level 26 from UNITY 5.6.6?

I made an AR app using UNITY 5.6.6 and I'm trying to publish my app to Google Play that need at least API Level 26. I have tried different ways to achieve that targeted level of API but achieved nothing and the Google Console only recognize my app'S API as level 22. Yes, it can be done easily if I use Unity earlier version (I am using Unity 2018 for my other published Apps), but I have to use this particular version because I'm using a little old plugin that only can be stable using those early versions of UNITY.
Here above some ways I've tried on Unity 5.6.6 :
I have tried using SDK tools version 26.1
I have tried using SDK tools version r25.2.5
sdkmanager
Here is my configuration I've tried on Build Settings-Other Settings
config 1
config 2
Here is the message I received from Google Console
google console message
I hope someone have experienced this and solved the problem. I appreciate your time and help alot! Thank you!
it seems unity 5.6 only goes up to api minimum of 25 (android 7.1)
api level 26 was released march of 2017 and unity 2017 was released in February 2017 for comparison
so unity 5.6 was done being updated before the release of api level 26
Yes, this is possible. If you set the Target API to "Automatic (highest installed)", Unity will use the highest version of the Android SDK that it detects on your system. For example, when I build using that setting in Unity 5.6, it uses API Level 28, since that is the highest version of the Android SDK that I have installed on my machine.

minimum android api for google cardboard [duplicate]

This question already has an answer here:
Unity says API level is too low
(1 answer)
Closed 5 years ago.
I have a unity project work with two devices one is android 5.1 and another is android 4.0. Right now I need to add googleVR to my unity project.
My unity app can be built and installed on android 5.1, but not the one with android 4.0, I know cardboard unity sdk require api above 19. But I just want to ship one apk file, even if the vr part doesn't work. I need it can be installed on android 4.0.
The apk can't be installed on android 4.0(api 15) says it requires api 19 or above.
After research, I found that in the AndroidManifest file, the minimum api is set to be 19, I change it to 15, and build failed with log " but library uses minSdkVersion='16'".
I think there must be one file specify the api level in the android sdk not the unity sdk. I know the .aar libs of the unity sdk are compiled from the cardboard android sdk project, the only way is to modify the original android sdk reset the api verion and compile. But after cloning the source code of android sdk, I can't find where they set the minimum api, and I am not sure how to build their android sdk code. Have anyone did that before?
Can Anyone Help???? Tons of Thanks!!!
The error you are getting is most likely from another manifest in plugins/android/gvr_android_common. You can open that package and change 16 to 15 and it'll build.
For me it gives no errors in Unity but logcat shows that it can't find some class/methods (DisplaySynchronizer) and it wont start the application.

Can I only install the newest Android API to target lower API Version?

Say I wanna make an app with :
android:minSdkVersion="8"
android:targetSdkVersion="22"
My questions :
Do I need to install both "min SDK Version" as well as the target SDK version?
How if I only have SDK Version of 23 only? Can I make such setting? Or do I need to have both 22 as well as 8?
Can I debug such app with API / SDK Ver 21 phone?
Is it enough to only have the latest SDK version to develop any kind of app?
It is okay if there's any source (link) to comprehensive rule about such ruling, since I didn't found it even after extensive searching.
P.S. I don't know if this info is needed, but the app I wanna make is a libgdx game app.
Thanks
No. (the other answer is wrong)
You only need to have the version that you building with (compileSdkVersion in build.gradle). If you only have 23, then build with 23.
Usually, you should target the same version you build with. However, libgdx is not always fully tested with the latest Android. Check here under Android build version to see what it has been tested for. This is the SDK level you should should target if you want to be sure not to have any problems. Right now, it is version 20 of Android.
I have been targeting Android 22 without issue (that I know of), though. I haven't yet released something higher than 20 yet so no guarantees that it's perfectly safe.
Yes.
Yes. Generally, the target SDK version and the build SDK version should match, but it works if you target a lower version than you're building with.
Targeting a later API basically changes some default behavior of apps. Theoretically, you should be testing on devices spanning the full range of API levels that you support, but in practice this is unnecessary for a libgdx game. But if you target a version that's too old, you might miss out on some newer features. For example, if you target <19, immersive mode (which is desirable for most games) cannot be supported.
Yes you need to install
If you have SDK Version of 23 only but you want to build it in version 22 then also you need to install vesrsion 22 SDK.
Yes you can easily debug such app with API / SDK Ver 21 phone.
I think its enough.

What SDK to install, seriously?

I know there are plenty of documents over the internet but I have still some doubts about what SDK to install on my computer to create an android application for nearly %100 devices to working with. Google Play says that if I use API 8 (which is Android 2.2) then my application work nearly all Android devices.
So I downloaded API 8 and API 22 (Android 5.1, was default installed by Android Studio itself) and I don't know if it works or not if I select Minimum SDK to API 8 while creating a new project.
So seriously guys, what the heck is going on?
What SDK Platform(s) you install has little to no impact on what versions of Android you can support.
If you create a new Android Studio project via the new-project wizard, you will find an app/build.gradle file. In there, you will find a setting named compileSdkVersion. This controls what version of the Android SDK you are compiling against (i.e., what JAR is used to satisfy compile-time references to Java classes like Activity and TextView). Whatever value you specify for compileSdkVersion must be an "SDK Platform" that you have installed from the SDK Manager.
In a newly-created project given your setup description from your question, you will see that compileSdkVersion is 22, lining up with pre-established API Level 22 edition of the SDK Platform.
However, this does not mean that your app will only run on API Level 22+ devices. Much of what is in the API Level 22 edition of the Android SDK has existed in previous versions of the SDK.
The minSdkVersion property in the same app/build.gradle file says how old you are willing to go -- what is the lowest API level you are willing to support. Right now, I think a new project will be set up with minSdkVersion of 15, though that varies over time. More importantly, you can change it to be whatever you want, and you do not need the SDK Platform installed for whatever level you choose.
If, in your code, you reference stuff in the Android SDK that is valid for your compileSdkVersion but is newer than the minSdkVersion, the build tools will point out the discrepancy, so you can make sure that you know what you are doing. This is how Android handles progressive enhancement -- you see what version of Android you are running on (Build.VERSION.SDK_INT) and use newer APIs where you can, falling back to older APIs as needed.
TL;DR: So long as your compileSdkVersion has a value for which you have an installed SDK Platform, you're set.
It depends on the application you are developing. And the resources that it will need. It's true that if you use the oldest version (API 8) and your application is simple enough, then it will work on any device.
But there are limitations to it. on older APIs you will not be able to use new features as Navigation drawer for example
I would recommend API 11 or 14, that covers most of the devices and features nowadays.
You should consider the design you want to create on your app
You can see the market share of the different api versions here: https://developer.android.com/about/dashboards/index.html
Then you have a trade-off of how advanced APIs you want to use vs. how many devices you want to support.

Categories

Resources