Android Build Failed (Error code: 256)

MacBook (macOS Catalina version 10.15.6)
Xcode Version 11.6 (11E708)

Copyright © 2009-2020 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2020.3610
Loading project from: ~/Desktop/giraffe.0.3.1
Project sandbox folder: ~/Library/Application Support/Corona Simulator/giraffe.0.3.1-12B0662A0EED4952DE0C711C82F39C7F
Platform: iPhone / x86_64 / 10.15.6 / Intel® HD Graphics 5300 / 2.1 INTEL-14.7.8 / 2020.3610 / en-US | US | en_US | en
applovin.init() WARNING: The Applovin Paid plugin is only supported on iOS and Android. Please build for device
Using java version “1.8.0_261”
Java™ SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot™ 64-Bit Server VM (build 25.261-b12, mixed mode)
Picked up JAVA_TOOL_OPTIONS: -Duser.language=en

Warning:
The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using “keytool -importkeystore -srckeystore /Applications/Corona/Corona Simulator.app/Contents/Resources/debug.keystore -destkeystore /Applications/Corona/Corona Simulator.app/Contents/Resources/debug.keystore -deststoretype pkcs12”.
Using java version “1.8.0_261”
Java™ SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot™ 64-Bit Server VM (build 25.261-b12, mixed mode)
Note: debug info is not being stripped from application (settings.build.neverStripDebugInfo = true)

BUILD SUCCESSFUL
Total time: 2 seconds
/private/var/folders/y8/vwcb8fzs2m36tytbg19k042c0000gn/T/CLtmpTboMLc/template/app/src/main/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-messaging:20.2.3] /Users/hj/.gradle/caches/transforms-2/files-2.1/8b4466384c6593c4f77678cffec6408e/jetified-firebase-messaging-20.2.3/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project’s minSdk version to at least 16,
or use tools:overrideLibrary=“com.google.firebase.messaging” to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:App:processReleaseManifest’.

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-messaging:20.2.3] /Users/hj/.gradle/caches/transforms-2/files-2.1/8b4466384c6593c4f77678cffec6408e/jetified-firebase-messaging-20.2.3/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project’s minSdk version to at least 16,
or use tools:overrideLibrary=“com.google.firebase.messaging” to force usage (may lead to runtime failures)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 22s
Android build failed (256) after 27 seconds
ERROR: Build Failed: Error code: 256

Add minSdkVersion = ‘16’ to the android section in build.settings

@Lerg Thanks

Or leave it at 15 and add this to the buildSettings.

manifestChildElements = 
        {
            -- Array of strings
            [[
            <uses-sdk tools:overrideLibrary="com.google.firebase.messaging" />
            ]]
        },

With this you can update, but did you succeed to launch the appli on a device?(I failed)

The ‘com.google.firebase.messaging’ needs min SDK 16. https://firebase.google.com/docs/cloud-messaging/android/client

You can force a library to work with an SDK under the min with the code I specified. Usually on devices not supported the library will just fail but other times it will work. You just have to put some guard rails in case the library fails to load. I do it all the time for other libraries so I can support a larger range of devices especially on the Amazon store. Here is what mine looks like:

[[
    <uses-sdk tools:overrideLibrary="com.flurry.android.analytics.sdk, 
plugin.tapjoyInstall, 
com.tappx.sdk.android"/>
    ]]

I had this problem when building from external HDD, as soon I copied the app folder to my local disk, it worked like a charm with no errors