Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Android Build Error: User is using a static STL but library requires a shared STL

Discussion in 'Android' started by jamiewhitephd, Jun 17, 2023.

  1. jamiewhitephd

    jamiewhitephd

    Joined:
    Jun 8, 2012
    Posts:
    132
    Hi everyone,

    I recently installed Unity 2023.1.0f1, along with the Android platform. I'm just trying to deploy a small project to my device and Gradle is giving me a bit of a hard time. In the past, this used to be a smooth process, but a lot seems to have changed in recent years and I am surprised that so much needs to be configured/fixed just to produce an APK. Thankfully, I managed to fix a lot of the build errors without too much trouble, but could someone clarify how to address this latest issue?

    Code (CSharp):
    1. FAILURE: Build failed with an exception.
    2.  
    3. * What went wrong:
    4. Execution failed for task ':unityLibrary:configureCMakeRelWithDebInfo[armeabi-v7a]'.
    5. > [CXX1212] D:\AndroidBuildTest\Library\Bee\Android\Prj\IL2CPP\Gradle\unityLibrary\src\main\cpp\CMakeLists.txt release|armeabi-v7a : User is using a static STL but library requires a shared STL [//games-frame-pacing/swappy]
    Many thanks!
     
  2. jamiewhitephd

    jamiewhitephd

    Joined:
    Jun 8, 2012
    Posts:
    132
    After browsing what must have been 100+ websites I discovered the "OptimiZed Frame Pacing" setting, which, when disabled, allows me to finally bypass this error.

    Now, I am faced with another (they don't seem to end):

    Code (CSharp):
    1. * What went wrong:
    2. Execution failed for task ':unityLibrary:generateReleaseBuildConfig'.
    3. > Error while evaluating property 'namespace' of task ':unityLibrary:generateReleaseBuildConfig'.
    4.    > Failed to calculate the value of task ':unityLibrary:generateReleaseBuildConfig' property 'namespace'.
    5.       > Failed to calculate the value of property 'namespace'.
     
    Jay_Mehta_97 likes this.
  3. ken048

    ken048

    Joined:
    Apr 22, 2016
    Posts:
    2
    Add
    namespace 'com.unity3d.player'
    to mainTemplate.gradle file

    ////
    ...

    // Android Resolver Exclusions End
    android {
    namespace 'com.unity3d.player'

    ndkPath "**NDKPATH**"

    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'
    ...
    ///
     
    Jay_Mehta_97 likes this.
  4. ken048

    ken048

    Joined:
    Apr 22, 2016
    Posts:
    2
    Thanks!
    It helps a lot!
     
  5. marios-trophygames

    marios-trophygames

    Joined:
    Oct 4, 2021
    Posts:
    14
    Hello, this is giving me a different error, specifically:

    Code (CSharp):
    1. changes  are not tracked, unable determine incremental changes
    Any clues?