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.
Related
I am trying to build an Android app to make a simple prototype. Using Microsoft Visual Studio 2022 (v17.2.4), I create an Android App (Xamarin), blank app. And I target Android 9.0 version.
But, I have compilation errors :
Could not find 2 Android X assemblies, make sure to install the following NuGet packages:
Xamarin.AndroidX.Lifecycle.LiveData
Xamarin.AndroidX.Browser
Problem is that I can't install these NuGet packages because they need Android 12.0 version or greater :
Package Xamarin.AndroidX.Lifecycle.LiveData 2.5.1 is not compatible with monoandroid90 (MonoAndroid,Version=v9.0). Package Xamarin.AndroidX.Lifecycle.LiveData 2.5.1 supports:
monoandroid12.0 (MonoAndroid,Version=v12.0)
net6.0-android31.0 (.NETCoreApp,Version=v6.0)
So I don't know how to solve this. I don't want to target Android 12 version, I need this app to launch on an Android 9.0 device.
What are these libraries the app need to compile? Can I do without them? I don't find any references to them.
Note : I have a warning too on the same way, but not sure if it has to deal with my compilation issue. I Put it anyway, if it can help :
Warning Google Play requires that new applications and updates must use a TargetFrameworkVersion of v11.0 (API level 30) or above. You are currently targeting v9.0 (API level 28).
Please, any idea to solve my issue?
I just want to compile and launch an Android (Xamarin) blank app targeting Android 9.0.
Thank you and have a good day,
I'm finding this a problem too. Just deployed an app (Dec 2022) that targeted 28 / 12 and has min version 10 as appears enforced by Google?
Prob is I've got a lot of people wanting to use the app that can't see it because they have ancient phones (9 or earlier - is that 5 years or more). Seems a bit tough? Is there a way to overcome this.
I assume that the today's Xamarin Android project templates are designed to compile with Android 12. I don't think there is a way to build them with Android 9.
I guess we just have to find another older template?
For my part I had finally took an older project I had instead of creating a new project.
I imported the Mapbox SDK (1.4.2) to my Unity project and wanted to build the project for Android. I want the app to run on the lowest Android version supported by Mapbox. According to the Mapbox website, the minimum API version is API 14 (Android 4.0.0). But when I try to build the project, it tells me that the library needs minimum API 24 (Android 7.0.0). However, I have set the project to have the minimum API 16 (Android 4.1) and the target API the highest installed (Android 8.1), so the project runs on every Android version in this range.
But when I try to build the project as .apk an error occurs indicating that the manifest merger failed.
Image showing the error which occurs in Unity
The two Android manifest .xml files are as followed:
/Users/user/Desktop/Project/Temp/StagingArea/android-libraries/com.mapbox.android.unity-debug/AndroidManifest.xml
(Image) Link to the content of the AndroidManifest.xml file
/Users/user/Desktop/Project/Temp/StagingArea/AndroidManifest-main.xml
(Image) Link to the content of the AndroidManifest-main.xml file
I don't know what to do. In the AndroidManifest.xml file it says that the minimum API version is 24 although I set the minimum API version in Unity to API 16 (Another image showing that I set the minimum API version to 16 in Unity). I've als tried to change the minimum API version in the AndroidManifest.xml file but after every build it's API 24 again.Thanks in advance!
Seems my response was deleted because it wasn't an answer, but since then my colleague has gotten in touch with the Mapbox devs, and they've responded here. Apparently, the Android Native GPS Plugin is set to support as low as level 24, which I don't understand given that the site claims the plugin supports much lower, unless I'm misreading it.
However, we implemented the fix in which you uncheck Android on the asset at
Assets/Mapbox/Unity/Location/Plugins/Android/com.mapbox.android.unity-debug
This seems to have worked.
I need to develop a test application for an old Samsung smartphone that has Android 2.3.6
I'm using Android Studio 3.1 and I've installed needed several old SDK from 2.1 to 2.3.3 including google api (that are showed as obsolete in sdk manager)
The problem is that when I create a new project, in the list where I can choose the SDK the lowest API available is 14; it seems that android studio is not showing me obsolete api and I cannot find where to set that I want to see all installed SDK.
Newer versions of Android Studio have minimum API level set to 14. I would suggest you look for android studio 2.3.3 which allows lower level APIs. Download link below:
https://developer.android.com/studio/archive
I face the same error while developing for the API 11. That was minimum of 14. But yes android studio never shows minimum then API 14. This is due to some Appcompat library.
Because when I dug out deeper then I found out that This Library was using minimum of 14 SDK. and due to manifest merging problem I think android studio is not showing minimum then that. At that time I was using 25.+ version of Appcompat library and I was using android studio 3.0.
You can find out more by selecting API 14 and then go into build.gradle file. now here you can change minSdkVersion to 11 or at any api level you want.
Then you can notice that while building you will get manifestMerger error with following proposed solutions
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 11 cannot be smaller than version 14 declared in library [com.android.support:appcompat-v7:26.1.0] \9fe0f18d3439e3d6185e96eddd3ec321\AndroidManifest.xml as the library might be using APIs not available in 11
Suggestion: use a compatible library with a minSdk of at most 11,
or increase this project's minSdk version to at least 14,
or use tools:overrideLibrary="android.support.v7.appcompat" to force usage (may lead to runtime failures)
So here is the problem and here you got the reason. May be some one can help you in bypassing it. I just thought to share my findings.
I am currently using Android Studio 3.0.1 and I have also experienced not being able to select api versions below 14 in the new project window, however I am unsure how to fix this issue directly. I have been successful as changing minSdkVersion (or using a project which had it already set) and haven't had a build issue. The same build issue appears to have solutions here, if you are experiencing this: Manifest merger failed : uses-sdk:minSdkVersion 14
I had a issue running the application on the emulator, as it was constantly waiting for the emulation to finish starting and this was fixed by updating the gradle as suggested by some notifications.
Otherwise I can only suggest trying the older ide version, especially if you are natively debugging using 32-bit windows, as it appears to not be supported in Android Studio 3. However after reading the release log it doesn't appear to mention excluding api below 14.
Native debugging with Android Studio no longer supports 32-bit Windows. We've chosen to focus on other platforms because very few developers are using this platform. If you are using 32-bit Windows and you plan to debug native code, you should keep using Android Studio 2.3.
[Source: https://developer.android.com/studio/releases/index.html]
Link to older ide version from the same source: https://developer.android.com/studio/archive.html#android-studio-2-3-3
I created a project with API level 8 (Android 2.2) and downloaded the 2.2 SDK in the SDK manager. When I run my android project this error was shown:
Error:(47, 21) No resource found that matches the given name: attr 'android:borderlessButtonStyle'.
I searched and found out that the borderless style is available on API level 11 and above so why did the Google Developers Hello World tutorial say to choose Android 2.2 so that all devices can run the app?
I changed the API level to 15 which solved the problem.
My question is why does the Android tutorial say to select 2.2 and then run application?
What should I do to run my first app on Android 2.2?
Download sdk for api level 15 on your sdk manager and then run the app in your emulator. Or even you could have set the target sdk version as 8 in your application. So please change it and then try running your app
Happy coding..
You misunderstood something. You should differentiate between android minimum SDK and the compile and target SDK you can see this link to know the difference.
You should target the latest version in the compile and target SDKs and set your min SDK as you like.
You are now getting this error because your are compiling with an old SDK and you are referring to some of the new APIs that are introduced after this API, they won't be used if you are using an older version, but they will use it in the later versions of the OS because it makes the process easier or getting the look and feel of the new versions of android.
This is happening in one of your libraries and I think it's the appcompat v7 library.
I have implemented admob code as given in google site (http://code.google.com/mobile/ads/docs/android/fundamentals.html) as described in google site we should target android 3.2 (api-13) in eclipse IDE to work properly. now my problem is my application targeting the android version 1.6 and above, since i made build target as andoird 3.2 it expects app should run on either 3.2 emulator or any of 3.2 device. i tried even installing on my 2.2 device but it didnt work.
Please help.
Thanks
The only thing you need to do is follow their instruction:
Requirements
The Google AdMob Ads SDK for Android requires Android 1.5 or later. Make sure you have the latest copy of the Android SDK and that you're compiling against at least Android v3.2 (set target in default.properties to android-13).
Using Android SDK Tool download android-13 SDK and modify your default.properties, do not change anything else like android:minSdkVersion in AndroidManifest.xml. Yes, you will get a little yellow warning message says version not match in Eclipse, just ignore it and build your application, you should be fine.