Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Appodeal gives Smaato error on Android
Started by bamazy Nov 25 2019 11:03 PM

23 replies to this topic

Best Answer agramonte , 26 November 2019 - 11:53 AM

My hero!

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

I don't know if it's related to Appodeal or Corona but I noticed Appodeal plugin got updated today both for Android and iOS, so I thought the update might have caused the error. 

 

For now, I have disabled "smaato".



[TOPIC: post.html]
#2

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

Sorry, probably should add it to build.settings:

        ['plugin.appodeal.Smaato'] = { publisherId = 'com.coronalabs' },        


[TOPIC: post.html]
#3

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, this time I get duplicate class error. As it's obvious from the last lines, I didn't paste all the logs. 

Unable to strip library '/private/var/folders/h8/dc7xymcn6n7b0h92jq4syzgc0000gn/T/CLtmpQPMpBF/template/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libjnlua5.1.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
                    Unable to strip library '/private/var/folders/h8/dc7xymcn6n7b0h92jq4syzgc0000gn/T/CLtmpQPMpBF/template/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libads.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
                    Unable to strip library '/private/var/folders/h8/dc7xymcn6n7b0h92jq4syzgc0000gn/T/CLtmpQPMpBF/template/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libgameNetwork.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
                    Unable to strip library '/private/var/folders/h8/dc7xymcn6n7b0h92jq4syzgc0000gn/T/CLtmpQPMpBF/template/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/libcorona.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
                    Unable to strip library '/private/var/folders/h8/dc7xymcn6n7b0h92jq4syzgc0000gn/T/CLtmpQPMpBF/template/app/build/intermediates/merged_native_libs/release/out/lib/x86_64/liblua.so' due to missing strip tool for ABI 'X86_64'. Packaging it as is.
Nov 26 07:41:25.401 
Nov 26 07:41:25.402 > Task :App:multiDexListRelease FAILED
Nov 26 07:41:26.700 > Task :App:bundleReleaseResources
Nov 26 07:41:26.701 
Nov 26 07:41:28.400 > Task :App:mergeReleaseJavaResource
Nov 26 07:41:28.401 FAILURE: Build failed with an exception.
                    
                    * What went wrong:
                    Execution failed for task ':App:multiDexListRelease'.
                    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
                       > Error while merging dex archives: 
                         Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
                         Program type already present: com.smaato.sdk.core.R
Nov 26 07:41:28.401 * 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 3m 37s
                    31 actionable tasks: 30 executed, 1 up-to-date
Nov 26 07:41:30.927 Android build failed (256) after 226 seconds
Nov 26 07:41:31.218 ERROR: Build Failed: Failed to Build
                    
                    Error code: 256
Nov 26 07:41:31.218 


[TOPIC: post.html]
#4

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

Can you share your build.settings?

[TOPIC: post.html]
#5

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

This has been around for a few releases of Appodeal and it is not unique to Corona. The first issue is that you have to include this for it to build. I suspect that Corona can add this if they have not already.

 

 

  • Some networks are using Java 8 features (e.g - Smaato), so please make sure your Android Gradle plugin version greater or equal 3.2.0 and add next compile options to your app-level build.gradle:

Copy
android {
// ... other options

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

 

The second issue is the min requirement for Smaato. I forget but on my native projects it throws an error requesting that I increase the min sdk to a number in the mid 20s. Either 24, 25 or 26.



[TOPIC: post.html]
#6

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

Their website says it's API level 16.

Weird that I don't get this problems :(



[TOPIC: post.html]
#7

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

@vlad Once I get home I'll send you the actual error. I should be home in a couple of hours.



[TOPIC: post.html]
#8

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

Here is the error:

 Task :App:mergeDexRelease FAILED
AGPBI: 
{"kind":"error","text":"Static interface methods are only 
supported starting with Android N (--min-api 24): 
java.lang.Exception com.smaato.sdk.core.network.execution.ErrorMapper.a(java.lang.Exception)",
"sources":[{}],"tool":"D8"}


[TOPIC: post.html]
#9

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

This is fixed now.


  • agramonte likes this

[TOPIC: post.html]
#10

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,274 posts
  • Corona SDK

  Best Answer

My hero!


  • vlads likes this

[TOPIC: post.html]
#11

lukascoossa

[GLOBAL: userInfoPane.html]
lukascoossa
  • Observer

  • 7 posts
  • Corona SDK

I am having a similar problem with appodeal. I also can't build my app with the appodeal plugin with the ERROR 256. The error message I get is

 

ERROR: configuring 'shared.google.play.services.location_com.coronalabs' failed!

 

I have commented out the gpgs2 plugin.

 

What does this mean and how can I fix this?

 

(I'm using Mac by the way)



[TOPIC: post.html]
#12

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

You're building for Android, I presume. Can you post your full build.settings and build log? use pastebin.com if possible, instead of pasting text here.



[TOPIC: post.html]
#13

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, I tried again but was not successful. 

['plugin.appodeal.Smaato'] = { publisherId = 'com.coronalabs' }, 

When including the above line, I get the below error and the build fails.

 

Here is the logs: https://pastebin.com/bEXVH9LJ

 

When deleting that line, the build is successful but I get "smaato not found" error when opening the app.

 

This is my build.settings: https://pastebin.com/Y62BhW5p



[TOPIC: post.html]
#14

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

It seems like you are running Java 13, and it is not fully supported by gradle (android build system). Java 1.8 (aka 8) is the best. I'm amazed that you can build without smaato.

I tried removing things which make Smaato "special" but then build breaks for everyone. If you want, I would suggest deleting java 13 and installing java 8 (this is my recommendation).

If you decide to disable smaato, you can do that to, and using "disableNetworks" like this:

appodeal.init( listener, { appKey="xxx", disableNetworks = {"smaato"} } )

Cheers!



[TOPIC: post.html]
#15

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, last time I had problem with Java versions, as per your recommendation, I installed and set Java 1.8 but somehow Corona uses Java 13 when building. Last time I noticed it but didn't open a new thread as it worked this way and I was able to build. Now I checked .bash_profile and noticed that I already have this line: 

export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)

By the way, when I type java -version, I get 1.8 as a default.

java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

I don't know how to make Corona to use the default java version.



[TOPIC: post.html]
#16

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

.bash_profile is launched when you start a new terminal and it launches bash command interpreter. Changes to bash_profile have no effect on Corona or any other GUI application, you only change environment for your new shell.

Changing default java for GUI applications is complicated. I would suggest deleting Java 13, unless you need it for other purposes.



[TOPIC: post.html]
#17

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

Also, we can try a little thing. Instead of starting Corona from the icon, try to run following command and see if it build would work:

JAVA_VERSION=1.8 /Applications/Corona-3556/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator

(this is one command, also, you may need to replace 3556 with your build number)



[TOPIC: post.html]
#18

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, thanks for the help. I used the last command and it was successful. No error at the beginning anymore. I'll add it to bash_profile as an alias and change the build number every time I update to newer version. 



[TOPIC: post.html]
#19

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

I think because you are starting Corona from bash it gets its JAVA_HOME from it. I wonder if it would work with just JAVA_VERSION set. May I ask you to “unset JAVA_HOME”. If it would work, I can make so it sets JAVA_VERSION itself, from next daily build.

[TOPIC: post.html]
#20

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, I ran the command "unset JAVA_HOME" and then opened Corona Simulator from the Launchpad. Then I just hit the build button and then canceled it to see the Java version it uses at the beginning of build process. I don't know if I understood you well and did the right things. However, it shows Java 13 at the beginning. 

 

Here is the logs: https://pastebin.com/KmsPUMuH

 

I also ran "/Applications/Corona-3556/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator" command and got the below lines:

Nov 28 10:26:43.278 Using java version "13.0.1" 2019-10-15
                    Java(TM) SE Runtime Environment (build 13.0.1+9)
                    Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
Nov 28 10:26:43.364 Picked up JAVA_TOOL_OPTIONS: -Duser.language=en

Am I doing everything as I was supposed to do?



[TOPIC: post.html]
#21

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

I'm sorry for being vague. Please, run this two commands consecutive in same terminal window and see if it build works:

unset JAVA_HOME
JAVA_VERSION=1.8 /Applications/Corona-3556/Corona\ Simulator.app/Contents/MacOS/Corona\ Simulator

Then, if it works, I can make that next Corona build would set JAVA_VERSION for itself. Need to know if it works first.



[TOPIC: post.html]
#22

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

I did exactly what you asked and it worked! :) So, it's good to check to see if the user has Java 1.8, and use it. It will ease the pain we as a users have when setting the right Java version. 

 

Thanks for you help!



[TOPIC: post.html]
#23

vlads

[GLOBAL: userInfoPane.html]
vlads
  • Contributor

  • 972 posts
  • Corona Staff

Corona 2019.3558 should just work for you. Please, download and try if it works for you.



[TOPIC: post.html]
#24

bamazy

[GLOBAL: userInfoPane.html]
bamazy
  • Contributor

  • 127 posts
  • Corona SDK

Vlads, I downloaded the latest build and it automatically selected Java 1.8. Great! 




[topic_controls]
[/topic_controls]