Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Onesignal build error 256 in Android
Started by gongalf Aug 06 2019 02:29 AM

8 replies to this topic
onesignal android build failed error code: 256
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

gongalf

[GLOBAL: userInfoPane.html]
gongalf
  • Observer

  • 3 posts
  • Corona SDK

Hello, I get a Build Failed alert when I try to build my app in Android with onesignal plugin added to build.settings. This is the log:


 

Aug 06 12:24:22.648 Using java version "1.8.0_201"
                    Java™ SE Runtime Environment (build 1.8.0_201-b09)
                    Java HotSpot™ 64-Bit Server VM (build 25.201-b09, mixed mode)
Aug 06 12:24:23.356 Building Android app for *********** with 2019.3512
Aug 06 12:24:24.559 Using custom build id from app bundle: 00000 (AppSettings.lua)
Aug 06 12:24:28.871 BUILD SUCCESSFUL
                    Total time: 2 seconds
Aug 06 12:25:04.833 /private/var/folders/4j/m59mm3h17ml6d5mxx92l8wcr0000gn/T/CLtmpTKk4Re/template/app/src/main/AndroidManifest.xml:95:11-91 Error:
                    Element service#com.onesignal.SyncService at AndroidManifest.xml:95:11-91 duplicated with element declared at AndroidManifest.xml:82:11-92
                    /private/var/folders/4j/m59mm3h17ml6d5mxx92l8wcr0000gn/T/CLtmpTKk4Re/template/app/src/main/AndroidManifest.xml Error:
                    Validation failed, exiting
                    
                    FAILURE: Build failed with an exception.
                    
                    * What went wrong:
Aug 06 12:25:04.841 Execution failed for task ':App:processReleaseManifest'.
                    > Manifest merger failed with multiple errors, see logs
Aug 06 12:25:04.842 * 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 35s
Aug 06 12:25:05.591 Excluding specified files from build: 
                       excluding: LaunchScreen.storyboardc
                       excluding: Icon.png
                       excluding: Icon-*dpi.png
                       excluding: Images.xcassets
                    Android build failed (256) after 41 seconds
Aug 06 12:25:05.834 ERROR: Build Failed: Failed to Build
                    
                    Error code: 256



Does anyone know what happens?

Thanks in advance.
 
P.S.: It built fine with previous versions (Corona-3490).


[TOPIC: post.html]
#2

alireza.poorsohoolat

[GLOBAL: userInfoPane.html]
alireza.poorsohoolat
  • Observer

  • 29 posts
  • Corona SDK

Please upload your android manifest file for more detailed debugging



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,309 posts
  • Enterprise

Share your build.settings file please.

 

Rob



[TOPIC: post.html]
#4

gongalf

[GLOBAL: userInfoPane.html]
gongalf
  • Observer

  • 3 posts
  • Corona SDK

This is the code:

--
-- For more information on build.settings see the Corona SDK Build Guide at:
-- https://docs.coronalabs.com/guide/distribution/buildSettings
--


settings =
{
splashScreen = 
    {
        enable = false,
        -- image = "splash.png"
    },


orientation =
{
-- Supported values for orientation:
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight


default = "portrait",
supported = { "portrait", },
},


excludeFiles =
{
-- Include only the necessary icon files on each platform
all = { "Icon.png", "Icon-*dpi.png", "Images.xcassets", },
android = { "LaunchScreen.storyboardc", },
-- iphone = { "Icon-*dpi.png", },
-- android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png", },
},


--
-- iOS Section
--
iphone =
{
xcassets = "Images.xcassets",
plist =
{
-- Importante para poder hacer request de sitios no seguros
NSAppTransportSecurity =
            {
NSExceptionDomains =
{
["gym.masdedos.es"] =
        {
NSIncludesSubdomains = true,
             NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
        },
["ufit365.com"] =
        {
NSIncludesSubdomains = true,
             NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
        },
["panel.upro365.com"] =
        {
NSIncludesSubdomains = true,
             NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
        },
["panel.ufit365.com"] =
        {
NSIncludesSubdomains = true,
             NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
        },
["panel.uwork365.es"] =
        {
NSIncludesSubdomains = true,
             NSThirdPartyExceptionAllowsInsecureHTTPLoads = true,
        },
},
            },
UIBackgroundModes = {"remote-notification"}, -- Agregado por OneSignal
UIStatusBarHidden = false,
UILaunchStoryboardName = "LaunchScreen",
--UIPrerenderedIcon = true, -- set to false for "shine" overlay
--UIApplicationExitsOnSuspend = false,
--UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend
NSLocationWhenInUseUsageDescription = "A description of why the app needs access to location services.",
},
},


--
-- Android Section
--
android =
{
usesPermissions =
{
"android.permission.INTERNET",
            "android.permission.CALL_PHONE",


            -- ************* SÓLO PARA UWORK (Comentar en otro caso) ****************
            -- Permission to retrieve current location from the GPS
            "android.permission.ACCESS_FINE_LOCATION",
            
            -- Permission to retrieve current location from WiFi or cellular service
            "android.permission.ACCESS_COARSE_LOCATION",
            -- **********************************************************************
},
        usesFeatures =
        {
            -- ************* SÓLO PARA UWORK (Comentar en otro caso) ****************
            -- If you set permissions "ACCESS_FINE_LOCATION" and "ACCESS_COARSE_LOCATION" above,
            -- you may want to set up your app to not require location services as follows.
            -- Otherwise, devices that do not have location sevices (such as a GPS) will be unable
            -- to purchase this app in the app store.
            { name = "android.hardware.location", required = false },
            { name = "android.hardware.location.gps", required = false },
            { name = "android.hardware.location.network", required = false }
            -- **********************************************************************
        },
},


--
-- Plugins
--
plugins =
    {
        ["plugin.OneSignal"] = -- Agregado por OneSignal
     {
         publisherId = "com.onesignal",
    },
    -- Omit if you're using 'plugin.googleAnalytics'
    -- ["plugin.google.play.services"] = -- Agregado por OneSignal
    -- {
    --     publisherId = "com.coronalabs",
    --     supportedPlatforms = { android=true, ["android-kindle"]=true },
    -- },
    -- Plugin para previsualizar pdfs y demás documentos
    ["CoronaProvider.native.popup.quickLook"] =
        {
            publisherId = "com.coronalabs",
     supportedPlatforms = { iphone=true, ["iphone-sim"]=true },
        },
        -- Plugin para mostrar el desplegable de redes sociales en las que compartir algo en Android.
        ["CoronaProvider.native.popup.social"] =
        {
            publisherId = "com.coronalabs"
        }, 
        -- Plugin para mostrar el pop up de redes sociales en las que compartir algo en iOS.       
        ["CoronaProvider.native.popup.activity"] =
        {
            publisherId = "com.coronalabs",
     supportedPlatforms = { iphone=true, ["iphone-sim"]=true },
        },
        -- Notificaciones locales
        -- ["plugin.notifications.v2"] =
        -- {
        --    publisherId = "com.coronalabs"
        -- },
    },
}


[TOPIC: post.html]
#5

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 903 posts
  • Corona SDK

I just have downloaded the newest Corona build 3517 and when trying to build for Android a huge package was downloaded first: Gradle I think

 

Then I get the error Failed to build / Error Code: 256

 

I have included the following new part with the applicationChildElementsto my build settings:

       android =
    {
                googlePlayGamesAppId = "XXXXXXXXXXXXXX", 
                 versionCode="XX",
                versionName="X.X",
                minSdkVersion = "14", 
                largeHeap = true,
                UIStatusBarHidden = true,
        usesPermissions =
        {
                    "com.android.vending.BILLING",
                    "com.android.vending.CHECK_LICENSE",
                    "android.permission.INTERNET",
                    "android.permission.VIBRATE"
        },
                usesFeatures =
        {
            { name="android.hardware.camera", required=false },
            { name="android.hardware.location", required=false },
            { name="android.hardware.location.gps", required=false },
        },

        -- new added to make admob work
        applicationChildElements =
        {
            [[
                <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID"
                    android:value="ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXXX"/>  -- replace with your app id. See: https://goo.gl/fQ2neu
            ]],
        }

    },

And in the log I get this message:

 

FAILURE: Build failed with an exception.

* What went wrong:
Gradle 5.1.1 requires Java 8 or later to run. You are currently using Java 7.

 

I tried to install Java 8 but it seems this is not working... I still get this message. Is The build system looking elsewhere for the Java version? Or how can I fix building again?

 

Any help welcome.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,309 posts
  • Enterprise

Have you tried to update to the latest Java JDK?

 

Rob



[TOPIC: post.html]
#7

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 903 posts
  • Corona SDK

Have you tried to update to the latest Java JDK?

 

Rob

 

I now have and the JAVA problem is gone (thanks for this) BUT I still get the error message 256. Here is some info from the build panel:

FAILURE: Build failed with an exception.

* Where:
Build file '/private/var/folders/gj/XXXXXXXXXXXXXXXX/T/CLtmpXXXXXXX/template/app/build.gradle.kts' line: 509

* What went wrong:
Forbidden

Any idea what can help here?



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,309 posts
  • Enterprise

If you're going to use any Corona build after 2019.3490, you're using our Android 64-bit beta version. We are still working out the kinks on it. My suggestion is visiting our Android 64-bit testing forum, read the pinned post at the top. Follow the instructions to increase the build's logging level and then share the error with us on that channel in a new thread. Don't piggy back on someone else's issue.

 

We are going to want to see your entire console log from the build, so use a service like pastebin.com so the forum post doesn't get insanely long and share your complete build.settings with us. Pastebin is good for that too.

 

Rob



[TOPIC: post.html]
#9

d.mach

[GLOBAL: userInfoPane.html]
d.mach
  • Contributor

  • 903 posts
  • Corona SDK

Okay, thanks a lot!




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: onesignal, android, build failed, error code: 256