Common Jenkins Build Issues

Problem: Couldn't set project path to:

14:25:40 COMMAND LINE ARGUMENTS:
14:25:40 /Applications/Unity/Hub/Editor/2021.3.9f1/Unity.app/Contents/MacOS/Unity
14:25:40 -quit
14:25:40 -buildTarget
14:25:40 Android
14:25:40 -username
14:25:40 builds@lionstudios.cc
14:25:40 -password
14:25:40 (hidden)
14:25:40 -projectPath
14:25:40 /Users/jenkins/build/workspace/LevelUpRunner
14:25:40 -
14:25:40 Android
14:25:40 -executeMethod
14:25:40 AutoBuilder.BuildAndroid
14:25:40 -Args:environment=Development;versionNumber=1;buildNumber=1;buildName=1(1);jdkPath=/Applications/Unity/Hub/Editor/2019.4.29f1/PlaybackEngines/AndroidPlayer/OpenJDK;reimportAssets=true;
14:25:40 -batchmode
14:25:40 -nographics
14:25:40 Couldn't set project path to:
14:25:4014:25:40 Aborting batchmode due to failure:

Solution:

There must be a space in your Jenkins Job name. Remove the space.


Problem: TextMeshPro assets missing in Jenkins build

Solution:

If the TextMeshPro-related assets are missing after building from Jenkins, then

  • Go to .gitignore file in your project’s root folder

  • Comment out or delete any TextMeshPro-related filters

  • Commit the TextMeshPro files that are in Assets/

    TextMeshPro_Files.png

Note: if there are no TextMeshPro files in Assets/, you must first open the Unity Project locally and accept the TextMeshPro popup.

To edit the .gitignore file:

With Sourcetree:

SettingsAdvancedRepository-specific ignore listEdit

SourceTree_gitignore.png

With file system:

  • Display hidden files and folders (MacOS: CMD + SHIFT + . )
  • Open the file .gitignore at the root of your repo


Problem: build crashes with error log: The Google Mobile Ads SDK was initialized incorrectly

The builds keep crashing, and the logs look like the below-shown image in the Android Logcat window.

GoogleMobileAdsConsoleLog.png

Solution:

An entry needs to be added to AndroidManifest.xml for Google Ad IDs. The ad ID would be located in the Applovin MAX AppLovin Integration Manager.

<manifest>
    <application>
        <!-- Sample Ad Manager app ID: ca-app-pub-3940256099942544~3347511713 -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy"/>
    </application>
</manifest>

Reference: https://developers.google.com/ad-manager/mobile-ads-sdk/android/quick-start#import_the_mobile_ads_sdk


Problem: The FaceBook Audience Network (FAN) SDK causes dependencies issues in pod installation

FAN_CocoaPodsError.png

Solution:

If no ads are being surfaced through FAN SDK, you can remove the FaceBook Audience Network SDK. Otherwise, change the method calls from AudienceNetwork settings to FB mobile.

FANtoFBMobile.png


Problem: The Provisioning Profile doesn’t have some capabilities in it which are required by the app, and the build fails

Solution:

  1. Contact your Product Manager or our QA Team to get the current provisioning profile.
  2. In your project, ensure you have a /ProvisioningProfiles folder. Place your provisioning profile in this folder, replacing any older version(s) with the same name.


Problem: Firebase Android errors

Solution:

Update Firebase. To update Firebase:

  • Delete Assets/Firebase

  • Delete Assets/GeneratedLocalRepo

  • Delete Assets/Plugins/<anything with Firebase in the filename>

  • Install the newer Firebase package

  • Delete Assets/Plugins/Android/AndroidManifest.xml

  • Delete Assets/Plugins/Android/mainTemplate.gradle

  • Delete Assets/Plugins/Android/launcherTemplate.gradle

  • Delete Assets/Plugins/Android/baseProjectTemplate.gradle

  • Delete Assets/Plugins/Android/gradleTemplate.properties

  • Uncheck then re-check the checkboxes in Publishing Settings (the ones that were already checked in your project).

    Firebase_PublishSettings.png

  • Click AssetsExternal Dependency ManagerAndroid ResolverForce Resolve

Firebase_ForceResolve.png


Problem: iOS build fails due to OpenVessel error in pod installation

OpenVessel_POD_Error.png

Solution:

To resolve this error, go to the AssetsOpenVesselPluginsEditorDependencies.xml

Add the parameter minTargetSdk=13.0 to the OpenVesselSDK iosPod line. Next, restart Unity. Unity should show that OpenVessel wants to update its target SDK version to 13.0. If it doesn’t, in Unity iOS Build Settings, manually update the Target SDK version from 11.013.0.

OpenVessel_TargetSDK.png


Problem: Applovin Cross Promo MRec error

error: no known class method for selector 'sizeMRec'

ALCrossPromo_mrecError.png

Solution:

This error results from Applovin Cross Promo version 1.0.0 installed in the project. To resolve this error, in your code editor go to:

AssetsAppLovin - CrossPromoPluginsiOS

and edit the line causing this error. Change the variable name from sizeMRec to mrec.

ALCrossPromo_SizeMRec.png


Problem: Facebook CoreKit fails the iOS build

error: Signing for "FBSDKCoreKit-FacebookSDKStrings" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'FBSDKCoreKit-FacebookSDKStrings' from project 'Pods')

FaceBookCoreKit.png

Solution:

The Facebook SDK needs to be updated to 14.1+. The updated version will require the client token from Facebook App settings. Please contact your Product Manager or Lion Support for help finding your client token.


Problem: NiceVibration creating Swift Language string and Facebook issues

NiceVibration_Swift_Version.png

The NiceVibration and Max SDK are likely overwriting each other’s code for SWIFT_VERSION.

Solution 1:

To resolve, manually edit MAX SDK’s code and set Swift version to 5.1. After fixing the Swift version error, if you are using FB SDK Version11.0.0 , there may be another error in your Xcode build:

NiceVibration_FaceBookError.png

Solution 2:

NiceVibrations, by Nice Mountains, has been replaced by FEEL, also by Nice Mountains, in the Unity Asset store.

  1. The NiceVibration package needs to be updated to FEEL package. Sign into the Unity Asset Store and download FEEL.

    1. https://assetstore.unity.com/packages/tools/particles-effects/feel-183370
  2. The code is quite different from NiceVibrations package, so there will be many syntax errors to fix:

    1. Namespace changed from MoreMountains.NiceVibrations to Lofelt.NiceVibrations
    2. MMVibrationManager is replaced by HapticController & HapticPatterns
    3. MMVibrationManager.SetActiveHapticController.hapticsEnabled
    4. HapticTypeHapticPatterns.PresetType
    MMVibrationManager.Haptic(HapticTypes.LightImpact) -> becomes ->
    HapticPatterns.PlayPreset(HapticPatterns.PresetType.LightImpact);
    

    e. MMVibrationManager.HapticHapticPatterns.PlayPreset

    f. MMVibrationManager.TransientHapticHapticPatterns.PlayEmphasis


Problem: Shader compiler initialization error: Failed to get ipc connection from UnityShaderCompiler shader compiler!

UnityShaderCompilerError.png

Solution:

In Project SettingsEditor section, uncheck Caching Preprocessor.

UnityShader_CachingPreprocessor.png

Problem: OneSignalNotificationServiceExtension

21:19:56 [!] Unable to find host target(s) for UnityFramework, OneSignalNotificationServiceExtension. Please add the host targets for the embedded targets to the Podfile.
21:19:57 Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
21:19:57 - Framework
21:19:57 - App Extension
21:19:57 - Watch OS 1 Extension
21:19:57 - Messages Extension (except when used with a Messages Application)

Solution:

Add OneSignal provisioning profiles


Problem: When uploading to Google Play, you see log messages that say, Upload Failed: - The Caller does not have permission

Solution:

Wrong credentials selected. Note that Lion Studios has separate Google Play accounts for:

  • Lion Studios,
  • Lion Studios Plus, and
  • HippoTap

Each game needs to use the correct credentials for the account that game is published under. Verify which store account your game is listed under and select those credentials.


Problem: Jenkins build fails due to IO directory not empty

This issue generally happens when we are trying to do incremental builds without using the delete workspace option from parameters.

IODirectoryError.png

Solution:

Rebuild the build with delete workspace enabled.


Problem: Jenkins iOS builds and uploads to TestFlight, but the TestFlight build crashes on start

Error log from console:

Error loading /var/containers/Bundle/Application/293CBE8E-0471-4698-A252-1D70A03231DA/TheRealJuggle.app/Frameworks/UnityFramework.framework/UnityFramework (140): dlopen(/var/containers/Bundle/Application/293CBE8E-0471-4698-A252-1D70A03231DA/TheRealJuggle.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/FBAEMKit.framework/FBAEMKit
 Referenced from: <36EA6546-8FFC-3C2C-AA37-D7206FDFF548> /private/var/containers/Bundle/Application/293CBE8E-0471-4698-A252-1D70A03231DA/TheRealJuggle.app/Frameworks/UnityFramework.framework/UnityFramework
 Reason: tried: '/usr/lib/swift/FBAEMKit.framework/FBAEMKit' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBAEMKit.framework/FBAEMKit' (no such file), '/usr/lib/swift/FBAEMKit.framework/FBAEMKit' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FBAEMKit.framework/FBAEMKit' (no such file), '/private/var/containers/Bundle/Application/293CBE8E-0471-4698-A252-1D70A03231DA/<>

Solution:

In iOS Resolver Settings, set Link Frameworks statically to false


Problem: Missing namespaces or classes from SDKs (obsolete)

Example:

20:18:32 Assets/Scripts/_SDKs/FacebookSdk.cs(6,7): error CS0246: The type or namespace name 'Facebook' could not be found (are you missing a using directive or an assembly reference?)

This is not necessarily Facebook, it could be other SDK classes or namespaces. The game’s repo probably uses git-lfs to store these library files, but the job doesn’t have the GIT LFS pull step.

Solution:

In the Source Code Management section, click the Add button under Additional Behaviors, and select Git LFS pull after checkout

GitLFSSetting.png

Save the project and it should now use git-lfs successfully.