I can't build for android, 256 Error

Hi,

I have a problem with android build. I use MacOs Mojave. I tried many different java versions but could not find a solution.

Nov 17 13:26:26.103 Copyright © 2009-2020 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2020.3626

Nov 17 13:26:27.226 Copyright © 2009-2020 C o r o n a L a b s I n c .
Version: 3.0.0
Build: 2020.3626

Nov 17 13:26:27.232 Loading project from: ~/Documents/Corona/Virus Fighter/v7

Nov 17 13:26:27.232 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v7-99B0DA6E87828EEFA3336C7E40D12ED4

Nov 17 13:26:27.269 Platform: iPhone / x86_64 / 10.14.5 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-2.9.26 / 2020.3626 / tr-TR | TR | en_TR | en

Nov 17 13:26:27.339 admob.init() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device

Nov 17 13:26:27.340 admob.isLoaded() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device

Nov 17 13:26:27.340

Nov 17 13:26:31.877 Using java version “1.8.0_241”
Java™ SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot™ 64-Bit Server VM (build 25.241-b07, mixed mode)

Nov 17 13:26:31.935 Picked up JAVA_TOOL_OPTIONS: -Duser.language=en

Nov 17 13:26:32.107 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 /Users/dogangokce/Desktop/Corona-3626/Corona Simulator.app/Contents/Resources/debug.keystore -destkeystore /Users/dogangokce/Desktop/Corona-3626/Corona Simulator.app/Contents/Resources/debug.keystore -deststoretype pkcs12”.

Nov 17 13:26:32.107

Nov 17 13:26:33.784 Using java version “1.8.0_241”
Java™ SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot™ 64-Bit Server VM (build 25.241-b07, mixed mode)

Nov 17 13:26:36.247 BUILD SUCCESSFUL
Total time: 1 second

Nov 17 13:26:47.416 Excluding specified files from build:
excluding: LaunchScreen.storyboardc
excluding: Icon.png
excluding: Icon-*dpi.png
excluding: Images.xcassets
/private/var/folders/c9/qm3yxv1d0cxggn31j8z7t2f40000gn/T/CLtmp3zuBN9/template/app/src/main/AndroidManifest.xml Error:
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.android.gms:play-services-ads:19.3.0] /Users/dogangokce/.gradle/caches/transforms-2/files-2.1/45a9235d65534d8fd9a377e7777608d8/jetified-play-services-ads-19.3.0/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.android.gms.ads.impl” 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.android.gms:play-services-ads:19.3.0] /Users/dogangokce/.gradle/caches/transforms-2/files-2.1/45a9235d65534d8fd9a377e7777608d8/jetified-play-services-ads-19.3.0/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.android.gms.ads.impl” 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

BUİLD FAILED in 10s

Nov 17 13:26:47.462 Android build failed (256) after 13 seconds

Nov 17 13:26:47.719 ERROR: Build Failed: Error code: 256

Nov 17 13:26:47.719

Doesn’t work :frowning:

Hi guys,
FYI I have the exact same failure, on Catalina, Build: 2020.3627

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-messaging:20.2.3]

which leads me there:

don’t know the impact to move upward to 16 though

got it working from the doc #minimum-sdk-version actually:

Just need to update the build.settings

android = {
   minSdkVersion = '16'
},
1 Like

When I downgrade the minimum version to 16, the app does not work on my lg v30 :frowning:

Adding it to the android section like this should work and has worked for me many times:

android =
	{
         manifestChildElements = 
        {
            [[<uses-sdk tools:overrideLibrary=<uses-sdk tools:overrideLibrary="com.google.android.gms.ads.impl"/>]]
            
        }

## other stuff here
}

If you get the error again keep adding them to the list. Just read the error it tells you what to add. On one of my apps it looks like this.

manifestChildElements = 
        {
            -- Array of strings
            [[
            <uses-sdk tools:overrideLibrary="com.flurry.android.analytics.sdk, 
com.tappx.sdk.android, 
com.ironsource.adapters.unityads, 
com.unity3d.ads, 
com.mopub.mobileads, 
com.mopub.mobileads,com.mopub.mobileads.banner, 
com.mopub.mobileads.rewarded_video, 
com.mopub.mobileads.interstitial, 
com.mopub.mobileads.native_static, 
com.mopub.mobileads.base"/>
            ]]

        },

Does’nt work for me :frowning:

Nov 25 15:14:41.759 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0
Nov 25 15:14:41.796 Build: 2020.3627
Nov 25 15:14:43.402 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:14:43.410 Loading project from: ~/Documents/Corona/Virus Fighter/v8 inmobi
Nov 25 15:14:43.410 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v8 inmobi-EB9101E682985227CCDAF00289B8F3ED
Nov 25 15:14:43.458 Platform: iPhone / x86_64 / 11.0.1 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-4.0.47 / 2020.3627 / tr-TR | TR | en_TR | en
Nov 25 15:14:43.535 inMobi.init() WARNING: The InMobi plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:14:43.535
Nov 25 15:14:43.537 inMobi.isLoaded() WARNING: The InMobi plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:14:43.537
Nov 25 15:14:47.948 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:14:48.020 Picked up JAVA_TOOL_OPTIONS: -Duser.language=en
Nov 25 15:14:48.197 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 /Users/dogangokce/Desktop/Corona-3627/Corona Simulator.app/Contents/Resources/debug.keystore -destkeystore /Users/dogangokce/Desktop/Corona-3627/Corona Simulator.app/Contents/Resources/debug.keystore -deststoretype pkcs12”.
Nov 25 15:14:54.514 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:14:55.454 Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar
Nov 25 15:14:57.172 BUILD SUCCESSFUL Total time: 1 second
Nov 25 15:15:11.873 Excluding specified files from build: excluding: LaunchScreen.storyboardc excluding: Icon.png excluding: Icon-*dpi.png excluding: Images.xcassets FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:App:compileReleaseJavaWithJavac’. > Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation. * 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 BUİLD FAILED in 13s
Nov 25 15:15:12.024 Android build failed (256) after 17 seconds
Nov 25 15:15:12.475 ERROR: Build Failed: Error code: 256
Nov 25 15:15:12.475
Nov 25 15:15:24.040 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:15:27.902 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:15:27.908 Loading project from: ~/Documents/Corona/Virus Fighter/v7 admob
Nov 25 15:15:27.909 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v7 admob-24AA3CA554576D82DDA391E452057311
Nov 25 15:15:27.956 Platform: iPhone / x86_64 / 11.0.1 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-4.0.47 / 2020.3627 / tr-TR | TR | en_TR | en
Nov 25 15:15:29.431 admob.init() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:15:29.431 admob.isLoaded() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:15:29.431
Nov 25 15:15:33.341 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:15:36.881 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:15:37.795 Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar
Nov 25 15:15:39.435 BUILD SUCCESSFUL Total time: 1 second
Nov 25 15:15:50.910 Excluding specified files from build: excluding: LaunchScreen.storyboardc excluding: Icon.png excluding: Icon-*dpi.png excluding: Images.xcassets /private/var/folders/c9/qm3yxv1d0cxggn31j8z7t2f40000gn/T/CLtmpWeP8rI/template/app/src/main/AndroidManifest.xml Error: uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.android.gms:play-services-ads:19.3.0] /Users/dogangokce/.gradle/caches/transforms-2/files-2.1/45a9235d65534d8fd9a377e7777608d8/jetified-play-services-ads-19.3.0/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.android.gms.ads.impl” 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.android.gms:play-services-ads:19.3.0] /Users/dogangokce/.gradle/caches/transforms-2/files-2.1/45a9235d65534d8fd9a377e7777608d8/jetified-play-services-ads-19.3.0/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.android.gms.ads.impl” 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 BUİLD FAILED in 10s
Nov 25 15:15:50.964 Android build failed (256) after 13 seconds
Nov 25 15:15:51.414 ERROR: Build Failed: Error code: 256
Nov 25 15:15:51.414
Nov 25 15:16:03.945 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:16:11.167 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:16:11.175 Loading project from: ~/Documents/Corona/Virus Fighter/v6 adcolony
Nov 25 15:16:11.175 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v6 adcolony-DD2011D48D1793C14B0F1DE94366AD91
Nov 25 15:16:11.218 Platform: iPhone / x86_64 / 11.0.1 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-4.0.47 / 2020.3627 / tr-TR | TR | en_TR | en
Nov 25 15:16:13.668 adcolony.init() WARNING: The AdColony plugin is only supported on iOS, Android and Amazon devices. Please build for device
Nov 25 15:16:13.668 adcolony.isLoaded() WARNING: The AdColony plugin is only supported on iOS, Android and Amazon devices. Please build for device
Nov 25 15:16:13.669
Nov 25 15:16:17.455 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:16:19.396 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:16:20.304 Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar
Nov 25 15:16:20.304
Nov 25 15:16:21.870 BUILD SUCCESSFUL Total time: 1 second
Nov 25 15:16:33.188 Excluding specified files from build: excluding: LaunchScreen.storyboardc excluding: Icon.png excluding: Icon-*dpi.png excluding: Images.xcassets FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:App:compileReleaseJavaWithJavac’. > Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation. * 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 BUİLD FAILED in 10s
Nov 25 15:16:33.249 Android build failed (256) after 13 seconds
Nov 25 15:16:33.520 ERROR: Build Failed: Error code: 256
Nov 25 15:16:33.521
Nov 25 15:16:43.809 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:16:46.301 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:16:46.310 Loading project from: ~/Documents/Corona/Virus Fighter/v5
Nov 25 15:16:46.310 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v5-0D055F0F18FD56630B4787E51DD0E65D
Nov 25 15:16:46.351 Platform: iPhone / x86_64 / 11.0.1 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-4.0.47 / 2020.3627 / tr-TR | TR | en_TR | en
Nov 25 15:16:50.963 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:16:53.353 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:16:54.270 Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar
Nov 25 15:16:54.270
Nov 25 15:16:55.844 BUILD SUCCESSFUL Total time: 1 second
Nov 25 15:17:04.371 Excluding specified files from build: excluding: LaunchScreen.storyboardc excluding: Icon.png excluding: Icon-*dpi.png excluding: Images.xcassets FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:App:compileReleaseJavaWithJavac’. > Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation. * 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 BUİLD FAILED in 7s
Nov 25 15:17:04.396 Android build failed (256) after 10 seconds
Nov 25 15:17:04.670 ERROR: Build Failed: Error code: 256
Nov 25 15:17:04.671
Nov 25 15:18:55.951 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:20:48.949 Copyright © 2009-2020 C o r o n a L a b s I n c . Version: 3.0.0 Build: 2020.3627
Nov 25 15:20:48.957 Loading project from: ~/Documents/Corona/Virus Fighter/v7 admob
Nov 25 15:20:48.958 Project sandbox folder: ~/Library/Application Support/Corona Simulator/v7 admob-24AA3CA554576D82DDA391E452057311
Nov 25 15:20:49.002 Platform: iPhone / x86_64 / 11.0.1 / AMD Radeon Pro 560X OpenGL Engine / 2.1 ATI-4.0.47 / 2020.3627 / tr-TR | TR | en_TR | en
Nov 25 15:20:49.038 admob.init() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:20:49.038 admob.isLoaded() WARNING: The AdMob plugin is only supported on Android & iOS devices. Please build for device
Nov 25 15:20:49.039
Nov 25 15:20:57.308 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:21:00.733 Using java version “1.8.0_271” Java™ SE Runtime Environment (build 1.8.0_271-b09) Java HotSpot™ 64-Bit Server VM (build 25.271-b09, mixed mode)
Nov 25 15:21:01.645 Unable to locate tools.jar. Expected to find it in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/tools.jar
Nov 25 15:21:03.212 BUILD SUCCESSFUL Total time: 1 second
Nov 25 15:21:15.522 Excluding specified files from build: excluding: LaunchScreen.storyboardc excluding: Icon.png excluding: Icon-*dpi.png excluding: Images.xcassets FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ‘:App:processReleaseManifest’. > com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException; lineNumber: 62; columnNumber: 34; Open quote is expected for attribute “tools:overrideLibrary” associated with an element type “uses-sdk”. * 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 BUİLD FAILED in 11s
Nov 25 15:21:15.578 Android build failed (256) after 14 seconds
Nov 25 15:21:15.867 ERROR: Build Failed: Error code: 256
Nov 25 15:21:15.867

This is often the solution
Download this: https://services.gradle.org/distributions/gradle-6.1.1-all.zip
And replace it with the one in your device

Usually, the error tells you the problem there is really no reason to guess. But I realized lately some people have a hard time picking up the error because there are so many words that show up around them. Anyway, the latest error is:

Open quote is expected for attribute “tools:overrideLibrary” associated with an element type “uses-sdk”.

So to me, this tells me that in your build setting you

  1. Have a miss-matched quote. Opening double or curly and closing with a single or non-curly.
  2. Have missing quotes completely.