pancake-llc / foundation

Game Mobile Foundation (Android + iOS) Using Unity3D. Simple, Fast and no GC
MIT License
111 stars 16 forks source link

Importing Admob and just trying to build Gives this error #99

Closed IAFahim closed 10 months ago

IAFahim commented 10 months ago

Sorry for asking for help, so directly.

Few weeks ago, I used was able to build it with AdMob before, but my friend told me as he is trying this project and can't build it.

First he tried to build cloning this project and tried building it. But it failed. I told him it might be because of IAP Settings.

Then created an empty project, and added Heart as a plugin. Then added the AdMob packages and symbols and variables and tried building it. But The dependency manager froze at 100%, so I sent him 2 screenshot to enable the custom Gradle. Which fixed the problem of Dependency manager freezing at 100% and instantly resolving. But it doesn't build with the almost same process which I did to build in the past. After I did the same, it's same for me, can't build it.

Can you please help us

The project where he was trying https://github.com/FahimKamal/Unity_Pancake_Package

Adding AdMob Package separately from Official GitHub Google Play Package works and he can build.

image image

image

1st Settings photo_6138940406105226055_x

2nd try WhatsApp Image 2024-01-16 at 5 51 23 PM

image

image

CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

Environment Variables:
PROCESSOR_ARCHITECTURE = AMD64
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
BURST_ANDROID_MIN_API_LEVEL = 22
DriverData = C:\Windows\System32\Drivers\DriverData
USERDOMAIN = NOVALABS-PC-06
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
COMPUTERNAME = NOVALABS-PC-06
DEBUG_ENV_VAR = UnityHub
LOGONSERVER = \\NOVALABS-PC-06
AMPLITUDE_TOKEN_GREENBUCKET_PROD = yyzPzalJDwrQcYNuOZam0bhKb26WyyhK
PUBLIC = C:\Users\Public
ProgramData = C:\ProgramData
SESSIONNAME = Console
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = Ph-837Q6GNodAkyc2MRkxVPUcjlIET4d
RlsSvcPort = 22112
ALLUSERSPROFILE = C:\ProgramData
SystemRoot = C:\Windows
windir = C:\Windows
AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0
ProgramFiles(x86) = C:\Program Files (x86)
ProgramW6432 = C:\Program Files
OS = Windows_NT
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
PROCESSOR_IDENTIFIER = AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD
HEAP_CLIENT_TOKEN_STAGING = 3786794399
HOMEPATH = \Users\Fahim
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
ACSetupSvcPort = 23210
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_13660_NURWTSRCHRUDMZPK
PROCESSOR_LEVEL = 25
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
CommonProgramFiles = C:\Program Files\Common Files
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
USERDOMAIN_ROAMINGPROFILE = NOVALABS-PC-06
TEMP = C:\Users\Fahim\AppData\Local\Temp
CommonProgramW6432 = C:\Program Files\Common Files
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
EFC_4532 = 1
AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994
VBOX_HWVIRTEX_IGNORE_SVM_IN_USE = 1
HOMEDRIVE = C:
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
USERNAME = Fahim
OneDrive = C:\Users\Fahim\OneDrive
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
AMPLITUDE_TOKEN_REDBUCKET_PROD = QqyoFpcWPi7V17p80_46CF6-sNGRGbHo
NUMBER_OF_PROCESSORS = 16
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
ComSpec = C:\Windows\system32\cmd.exe
ORIGINAL_XDG_CURRENT_DESKTOP = undefined
PROCESSOR_REVISION = 2102
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS
TMP = C:\Users\Fahim\AppData\Local\Temp
SystemDrive = C:
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
ACSvcPort = 17532
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
HEAP_CLIENT_TOKEN = 1717415662
APPDATA = C:\Users\Fahim\AppData\Roaming
Path = C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin;C:\Program Files\Git\cmd;C:\Users\Fahim\AppData\Local\Microsoft\WindowsApps;C:\Users\Fahim\AppData\Local\GitHubDesktop\bin;C:\Users\Fahim\AppData\Local\JetBrains\Toolbox\scripts;
ProgramFiles = C:\Program Files
LOCALAPPDATA = C:\Users\Fahim\AppData\Local
USERPROFILE = C:\Users\Fahim
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3

stderr[
Picked up JAVA_TOOL_OPTIONS: -D
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':launcher:debugRuntimeClasspath'.
   > Could not find com.chartboost:chartboost-sdk:9.4.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - https://repo.maven.apache.org/maven2/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - https://maven.google.com/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - https://android-sdk.is.com/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - https://artifact.bytedance.com/repository/pangle/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - file:/C:/Users/Fahim/.m2/repository/com/chartboost/chartboost-sdk/9.4.0/chartboost-sdk-9.4.0.pom
       - file:/C:/UnityProjects/Personal/Unity_Pancake_Package/Pancake_package/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/chartboost-sdk-9.4.0.jar
       - file:/C:/UnityProjects/Personal/Unity_Pancake_Package/Pancake_package/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/libs/chartboost-sdk.jar
     Required by:
         project :launcher > project :unityLibrary > com.google.ads.mediation:chartboost:9.4.0.0

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unityLibrary:generateDebugRFile'.
> Could not resolve all files for configuration ':unityLibrary:debugCompileClasspath'.
   > Could not find com.chartboost:chartboost-sdk:9.4.0.
     Required by:
         project :unityLibrary > com.google.ads.mediation:chartboost:9.4.0.0

* 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 6s

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
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
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
> Task :launcher:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResources UP-TO-DATE
> Task :launcher:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:packageDebugResources UP-TO-DATE
> Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
> Task :unityLibrary:processDebugManifest UP-TO-DATE
> Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
> Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
> Task :launcher:checkDebugAarMetadata FAILED
> Task :unityLibrary:generateDebugRFile FAILED
11 actionable tasks: 2 executed, 9 up-to-date

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
aprius commented 10 months ago

Okay, I'll take a look at it

aprius commented 10 months ago

It seems that Admob Sdk is missing files from the Android folder. You should try rechecking the installation of Admob SDK

Notes: Remember force resolve after re-install admob sdk

image

I have tried building successfully with Unity 2023.2.5f1

aprius commented 10 months ago

You can use button Install Admob Sdk inside Advertising to install admob package is included in heart

image

IAFahim commented 10 months ago

I couldn't import the package using the button. As External Dependency Manager, it gets stuck at 100% But found a workaround with Just importing it to the package from https://github.com/googleads/googleads-mobile-unity and drag and dropping it.

Thank you so much, you even downloaded that version to test it. Thank you soooo much. And the new Advertisement drawer, nice.