Unity Mapbox Android Build Failure Manifest - android

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.

Related

Targeting API 8 (Android 2.2) using Android Studio causes merger failed error

I am attempting to create a simple app for a very old phone:
HTC Aria, Android 2.2, API level 8
In Android Studio, when I install the SDK version 8 and set minSdkVersion/targetSdkVersion in build.gradle, but it refuses to build.
Changing the API level in File > Project Structure also does not work. The error is as follows:
Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 14 declared in library [com.android.support:appcompat-v7:26.1.0] /home/oliver/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/ccbf7c84a168d3e32184f6d6f1423c07/AndroidManifest.xml as the library might be using APIs not available in 8
Suggestion: use a compatible library with a minSdk of at most 8,
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)
Adding the overrideLibrary does not help, the error just switches to complaining about a different library. Is it even still possible to create Android 2.2/API 8 apps in Android Studio? If so, how can I do so?
You cannot use the latest Android Support Library with an API lower than 14.
Caution: Starting with Support Library release 26.0.0 (July 2017), the minimum supported API level across most support libraries has increased to Android 4.0 (API level 14) for most library packages. For more information, see Version Support and Package Names in this document.
Is it even still possible to create Android 2.2/API 8 apps in Android Studio?
Yes
If so, how can I do so?
Use the older support Library (anything under 26.0.0) or don't use the support library at all. Limit yourself to classes and methods available from API 8 and lower.
Creating a Froyo [SDK INT: 8] app in 2019 turned out to be a bit difficult...
To make a long story short, I had to do this to overcome a defect in the GooglePlay console that prevented me from updating my app. [Related to the new SMS permissions policy]
Procedure for creating an Android app with a min SDK INT of 8 in Android Studio 3.2.1:
File -> New -> New Project
You will have to select a minimum version of 15 for now since that is as low as the drop-down menu currently goes [Note: installing the Froyo SDK will not help either]
Select "Add No Activity" to keep the project simple.
Once the project is built go into the app-level build.gradle file and change the min SDK to 8
Go into the AndroidManifest.xml file and remove any theme related code
Go into the values/styles.xml file and remove any theme related code
Manually create your own activity [Warning: Do not do "File -> New -> Activity" since it will start inserting support library code in multiple places throughout the project]
Create a simple class derived from Activity
Create a layout for it in the res/layout directory
Add the activity tag to the manifest
That's it. I was able to install a min Froyo [SDK INT: 8] app on my Oreo device.

Android studio 3 not showing Android 2.3 sdk API 10 for a new project altought sdk is installed

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

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.

How to resolve build issue in eclipse?

I am using my app on api level 22. I need to change the api level to use the in app purchase functionality. When I change the target version from 20 to 21 then clean the project, I found that there are many error messages. the reason is on the clean the gen folder not creating the required files.
While when I change the target version from 21 to 20 it is working fine.

Android Error: This template requires a build target API version of at least 14, and the current version is 7

I installed the SDK and I like work with API 7 but when I want to create a new Activity Main I have this problem and I can't create a new Activity, thanks.
This template requires a build target API version of at least 14, and the current version is 7
In the log, I can read this:
Not targeting the latest versions of Android; compatibility modes apply. Consider testing
and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.
I recently faced the same problem when creating the activity or while setting the new android application project and able to solve this problem in this manner.
I checked the system image folder which is in sdk/system-images,build tools folder-sdk/build-tools and found that these folder does not have the API's that i am using at Minimum required sdk,target sdk,compile with. In each of these you need to provide the API no. or Android version.
So check that the API's that you are using for(Minimum required sdk,target sdk,compile with) are installed and also check the system-images and build-tools folder should have these API's
if you have done this your problem must be solved.
You probably set Build SDK to API 7. Normally, you should set Build SDK to the highest possible API level and set the other SDK, it's called Run SDK or don't rememeber how to the minimum API version you want your application to run on.
I ran into this same issue even though I had set in my AndroidManifest.xml minSdkVerion to 13 and targetSdkVersion to 19. What fixed it for me was in Eclipse going to Project > Properties > Android then checking the highest API level in Project Build Target box (API 19 for me).

Categories

Resources