AppLovin / AppLovin-MAX-SDK-Android

Other
210 stars 95 forks source link

Android Gradle build Failed on new SDK version #584

Closed EAdemov closed 7 months ago

EAdemov commented 7 months ago

MAX SDK Version

12.0.0

Device/Platform Info

Android

Current Behavior

uses-sdk:targetSdkVersion 33 cannot be different than version android-TiramisuPrivacySandbox declared in library [com.applovin:applovin-sdk:12.0.0]

Expected Behavior

No response

How to Reproduce

update android sdk to 12.0.0 targetSdkVersion set to 33

Additional Info

No response

tiandrew commented 7 months ago

Hi @EAdemov, we're unable to reproduce this issue on our side. Can you double check that you don't have a targetSdkVersion defined in your Android Manifest? It should only be defined in your Gradle file. If that's not the issue, could you try reproducing the issue in our demo app here and send it to me?

SalavatR commented 7 months ago

Same issue, we also define targetSdkVersion in our manifest, but we use it in defold engine,and it’s problematic to change something in 12.0.0 sdk defined

    uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="android-TiramisuPrivacySandbox" 
Flake174 commented 7 months ago

@tiandrew could you check please, what is the value of "android-TiramisuPrivacySandbox" in your package? Screenshot 1

tiandrew commented 7 months ago

Hey everyone, we will be fixing this in our next release. In the meantime, you can override our library version by adding this (using SDK version 30 as an example):

<uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="30"
        tools:overrideLibrary="com.applovin" />

Please be sure to import xmlns:tools="http://schemas.android.com/tools" as well.

tiandrew commented 6 months ago

Hey @Flake174 and @SalavatR, our newest SDK version 12.1.0 has removed the target SDK version and should no longer have this conflict.

Mert0zdemir commented 5 months ago

Hey @tiandrew When I update your SDK to 12.1.0 with Unity 2022.3.17f1, Target Api Level 34, I receive all the errors. I have no problems using 12.0.0.

FIRST:

Configure project :launcher WARNING:The option setting 'android.bundle.enableUncompressedNativeLibs=false' is deprecated. The current default is 'true'. It will be removed in version 8.0 of the Android Gradle plugin. You can add the following to your build.gradle instead: android { packagingOptions { jniLibs { useLegacyPackaging = true } } }

AppLovin Quality Service Plug-in for Gradle and Android Studio Version 5.0.7 Copyright (c) 2023 AppLovin Ltd. All rights reserved.

WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

This warning can be suppressed by adding android.suppressUnsupportedCompileSdk=34 to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to use a newer Android Gradle Plugin that has been tested with compileSdk = 34

SECOND: Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

THIRD:

CommandInvokationFailure: Gradle build failed. /Applications/Unity/Hub/Editor/2022.3.17f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2022.3.17f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "bundleRelease"

Please can you share with me if you have any ideas about what I can do for a permanent solution? Because I have tried everything that can be found on the web but I cannot get around this problem. THANK YOU!

tiandrew commented 5 months ago

Hey @Mert0zdemir, it looks like you may have to update your gradle plugin to a version compatible with Android API level 34. If that doesn't resolve your issue, can you try reproducing this issue in our demo app?

Mert0zdemir commented 5 months ago

@tiandrew Thank you for your answer. I'm using gradle, which came with Unity's API 34 update, and it's not working. So until today I've never had to manually update gradle after an sdk update before. For this reason, could you please share with me the Gradle version number that your SDK will be compatible with? For example, I tried Gradle 8.0 but it didn't work.

tiandrew commented 5 months ago

Hey @Mert0zdemir, it's strange you're seeing this issue because Gradle version 7.2 should be high enough. Can you please send what version for Gradle and Android Gradle Plugin you are using in your Unity project? If you could also reproduce this issue in a clean project with our SDK integrated such as our demo app that would help narrow down the issue.

Mert0zdemir commented 5 months ago

@tiandrew First of all, thank you for your interest and answer. I incredibly still continue to experience all the errors. I have no slightest idea about what to do. Because, no matter what I do, I can't fix this error! I'm providing the information you requested below, please find a solution for me. It's impossible for me to build my project from scratch based on your demo project, as it has been evolving for 2 years with every detail. :)

External Dependency Manager Version 1.2.176 Android Gradle plugin (7.1.2) distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

thomasmso commented 5 months ago

@Mert0zdemir - If you cannot reproduce it in our demo app, then it is an issue with your Gradle setup. We understand Gradle can be complex to debug, but it is beyond the scope of our support.

Mert0zdemir commented 4 months ago

Hi @thomasmso thx your answer. I didn't say I couldn't do it your demo, I said I wouldn't. Because it is a very big project. In addition, all my other projects that I updated to Applovin 12.1 can no longer run gradle. Please realize that this error is caused by your update and fix it. A total of 4 projects become inoperable when we update your SDK.

thomasmso commented 4 months ago

@Mert0zdemir - Perhaps you can try uninstalling Ad Review?

Mert0zdemir commented 4 months ago

@thomasmso I'm so sorry, no matter what I try, I can't get past this problem! I'm trying 12.2.0 and still the same problem. There is no such error when I install the SDK of any other ad network! I will desperately have to give up the MAX that I have been using for years. Because they are not working towards a real solution to this problem. :(

thomasmso commented 4 months ago

@Mert0zdemir - What if you just drop back to our latest SDK prior to the current major release? So version 11.11.2.

Mert0zdemir commented 4 months ago

@thomasmso Of course I would like to go back, the version had no problems at all. However, I could not find a repository where you can share old versions. I would appreciate it if you could share a link where I can download it.

thomasmso commented 4 months ago

@Mert0zdemir - Maven Central: https://repo.maven.apache.org/maven2/com/applovin/applovin-sdk/