블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-19 21:33
// jave.lin 2022.03.17

using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

// jave.lin : 输出系统的信息工具类
public class DumpSystemInfoUtil
{
    // jave.lin : 通过反射得方式获取不了
    public static string DumpSystemInfoByReflection()
    {
        var type = typeof(SystemInfo);
        // jave.lin : 下面发现反射不成功
        var fields = type.GetFields(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
        var fieldsToStrList = new List<string>();
        foreach (var field in fields)
        {
            // 过滤 过期得 API
            var obsoAttris = field.GetCustomAttributes(typeof(ObsoleteAttribute), true);
            if (obsoAttris != null && obsoAttris.Length > 0) continue;
            fieldsToStrList.Add(field.Name + ":" + field.GetValue(null).ToString());
        }
        return string.Join("\n", fieldsToStrList.ToArray());
    }

    // jave.lin : 所以只能通过一个个得去输出
    public static string DumpSystemInfoByManualyPrint()
    {
        var list = new List<string>(
            new string[]{
                "SystemInfo:\n",
                "\tbatteryLevel:" + SystemInfo.batteryLevel,
                "\tbatteryStatus:" + SystemInfo.batteryStatus,
                "\toperatingSystem:" + SystemInfo.operatingSystem,
                "\toperatingSystemFamily:" + SystemInfo.operatingSystemFamily,
                "\tprocessorType:" + SystemInfo.processorType,
                "\tprocessorFrequency:" + SystemInfo.processorFrequency,
                "\tprocessorCount:" + SystemInfo.processorCount,
                "\tsystemMemorySize:" + SystemInfo.systemMemorySize,
                "\tdeviceUniqueIdentifier:" + SystemInfo.deviceUniqueIdentifier,
                "\tdeviceName:" + SystemInfo.deviceName,
                "\tdeviceModel:" + SystemInfo.deviceModel,
                "\tsupportsAccelerometer:" + SystemInfo.supportsAccelerometer,
                "\tsupportsGyroscope:" + SystemInfo.supportsGyroscope,
                "\tsupportsLocationService:" + SystemInfo.supportsLocationService,
                "\tsupportsVibration:" + SystemInfo.supportsVibration,
                "\tsupportsAudio:" + SystemInfo.supportsAudio,
                "\tdeviceType:" + SystemInfo.deviceType,
                "\tgraphicsMemorySize:" + SystemInfo.graphicsMemorySize,
                "\tgraphicsDeviceName:" + SystemInfo.graphicsDeviceName,
                "\tgraphicsDeviceVendor:" + SystemInfo.graphicsDeviceVendor,
                "\tgraphicsDeviceID:" + SystemInfo.graphicsDeviceID,
                "\tgraphicsDeviceVendorID:" + SystemInfo.graphicsDeviceVendorID,
                "\tgraphicsDeviceType:" + SystemInfo.graphicsDeviceType,
                "\tgraphicsUVStartsAtTop:" + SystemInfo.graphicsUVStartsAtTop,
                "\tgraphicsDeviceVersion:" + SystemInfo.graphicsDeviceVersion,
                "\tgraphicsShaderLevel:" + SystemInfo.graphicsShaderLevel,
                "\tgraphicsMultiThreaded:" + SystemInfo.graphicsMultiThreaded,
                "\tsupportsShadows:" + SystemInfo.supportsShadows,
                "\tsupportsRawShadowDepthSampling:" + SystemInfo.supportsRawShadowDepthSampling,
                "\tsupportsMotionVectors:" + SystemInfo.supportsMotionVectors,
                "\tsupports3DTextures:" + SystemInfo.supports3DTextures,
                "\tsupports2DArrayTextures:" + SystemInfo.supports2DArrayTextures,
                "\tsupports3DRenderTextures:" + SystemInfo.supports3DRenderTextures,
                "\tsupportsCubemapArrayTextures:" + SystemInfo.supportsCubemapArrayTextures,
                "\tcopyTextureSupport:" + SystemInfo.copyTextureSupport,
                "\tsupportsComputeShaders:" + SystemInfo.supportsComputeShaders,
                "\tsupportsInstancing:" + SystemInfo.supportsInstancing,
                "\tsupportsHardwareQuadTopology:" + SystemInfo.supportsHardwareQuadTopology,
                "\tsupports32bitsIndexBuffer:" + SystemInfo.supports32bitsIndexBuffer,
                "\tsupportsSparseTextures:" + SystemInfo.supportsSparseTextures,
                "\tsupportedRenderTargetCount:" + SystemInfo.supportedRenderTargetCount,
                "\tsupportsMultisampledTextures:" + SystemInfo.supportsMultisampledTextures,
                "\tsupportsMultisampleAutoResolve:" + SystemInfo.supportsMultisampleAutoResolve,
                "\tsupportsTextureWrapMirrorOnce:" + SystemInfo.supportsTextureWrapMirrorOnce,
                "\tusesReversedZBuffer:" + SystemInfo.usesReversedZBuffer,
                "\tnpotSupport:" + SystemInfo.npotSupport,
                "\tmaxTextureSize:" + SystemInfo.maxTextureSize,
                "\tmaxCubemapSize:" + SystemInfo.maxCubemapSize,
                "\tsupportsAsyncCompute:" + SystemInfo.supportsAsyncCompute,
                "\tsupportsAsyncGPUReadback:" + SystemInfo.supportsAsyncGPUReadback,
                "\tsupportsMipStreaming:" + SystemInfo.supportsMipStreaming,
            });
        return string.Join("\n", list.ToArray());
    }
}

// jave.lin : 设备定档级别枚举
public enum eDeviceLevel
{
    Unknow = -1,
    VeryLow = 0,
    Low,
    Middle,
    High,
}

// jave.lin : 画质级别
public enum eQualityLevel
{
    Low = 1,
    Middle = 2,
    High = 3,
    Ultra = 4,
}

// jave.lin : shader lod
public enum eShaderLOD
{
    //High = 800,
    //Middle = 400,
    //Low = 200,
    //VeryLow = 100,
    //UnLimit = -1,
    // jave.lin : 太低的值对 built-in shader 的影响太大
    High = 800,
    Middle = 600,
    Low = 400,
    VeryLow = 200,
    UnLimit = -1,
}

// jave.lin : 游戏的质量设置类
public class GameQualitySettings
{
    private const string QS_POWER_SAVE_MODE_KEY = "graphics_setting.power_save_mode";
    private const string QS_QUALITY_LEVEL_KEY = "graphics_setting.quality_level";

    // 当 品质有调整事出发的事件函数
    public static Action<eQualityLevel> onLevelChanged;

    // 源来的 AA 和 阴影设置
    private static int srcAntiAliasing;
    private static ShadowQuality srcShadows;

    // 当前 品质等级
    private static eQualityLevel curLevel;

    // 获取 设备定档的质量级别
    public static eQualityLevel DeviceAdapterLevel
    {
        get; private set;
    }

    // 获取 或 设置 公开给外部的画质设置的属性
    public static eQualityLevel GraphicsLevel
    {
        get { return curLevel; }
        set
        {
            if (curLevel != value)
            {
                curLevel = value;
                _SetCurLevel(value);
                PlayerPrefs.SetInt(QS_QUALITY_LEVEL_KEY, (int)value);
                if (null != onLevelChanged)
                {
                    onLevelChanged.Invoke(value);
                }
            }
        }
    }

    // 获取 或 设置 省电模式, true: 30FPS, false: 60FPS
    public static bool PowerSaveMode
    {
        get
        {
            return Application.targetFrameRate < 40;
        }

        set
        {
            var src_v = PlayerPrefs.GetInt(QS_POWER_SAVE_MODE_KEY, -1);
            var tar_v = value ? 1 : 0;
            if (src_v != tar_v)
            {
                PlayerPrefs.SetInt(QS_POWER_SAVE_MODE_KEY, tar_v);
            }
            Application.targetFrameRate = value ? 30 : 60;
        }
    }

    // 静态构造函数
    static GameQualitySettings()
    {
        // 备份 原始 AA 和 阴影
        srcAntiAliasing = QualitySettings.antiAliasing;
        srcShadows = QualitySettings.shadows;

        // 初始化 品质 和 省电模式
        _SetDefaultPowerSaveMode();
        _SetDefaultLevel();
    }

    // 设置默认的品质等级
    private static void _SetDefaultLevel()
    {
        // 先 分析 并 设置 设备默认品质等级
        DeviceAdapterLevel = _AnalysicDeviceLevel();

        var src_v = PlayerPrefs.GetInt(QS_QUALITY_LEVEL_KEY, -1);
        // 如果品质等级没有设置过
        if (src_v == -1)
        {
            // 那么使用 设备默认品质
            PlayerPrefs.SetInt(QS_QUALITY_LEVEL_KEY, (int)DeviceAdapterLevel);
            curLevel = GraphicsLevel;
        }
        // 如果品质等级有设置过
        else
        {
            curLevel = (eQualityLevel)src_v;
        }
    }

    // 设置默认的省电模式
    private static void _SetDefaultPowerSaveMode()
    {
        var src_v = PlayerPrefs.GetInt(QS_POWER_SAVE_MODE_KEY, 0);
        if (src_v == 0)
        {
            PowerSaveMode = true;
            PlayerPrefs.SetInt(QS_POWER_SAVE_MODE_KEY, 1);
        }
        else
        {
            PowerSaveMode = src_v == 1;
        }
    }

    // 分析设备所属默认的品质等级
    private static eQualityLevel _AnalysicDeviceLevel()
    {
        if (SystemInfo.processorFrequency >= 2500 &&
            SystemInfo.processorCount >= 8 &&
            SystemInfo.systemMemorySize >= (6 * 1024) &&
            SystemInfo.graphicsMemorySize >= (2 * 1024) &&
            SystemInfo.graphicsShaderLevel >= 30 &&
            SystemInfo.graphicsMultiThreaded &&
            SystemInfo.supportsShadows &&
            SystemInfo.supportsInstancing &&
            SystemInfo.supports32bitsIndexBuffer
            )
        {
            return eQualityLevel.Ultra;
        }
        else if (SystemInfo.processorFrequency >= 2000 &&
            SystemInfo.processorCount >= 4 &&
            SystemInfo.systemMemorySize >= (4 * 1024) &&
            SystemInfo.graphicsMemorySize >= (1 * 1024) &&
            SystemInfo.graphicsShaderLevel >= 20
            )
        {
            return eQualityLevel.High;
        }
        else if (SystemInfo.processorFrequency >= 1500 &&
            SystemInfo.processorCount >= 2 &&
            SystemInfo.systemMemorySize >= (2 * 1024) &&
            SystemInfo.graphicsMemorySize >= (512) &&
            SystemInfo.graphicsShaderLevel >= 10
            )
        {
            return eQualityLevel.Middle;
        }
        else
        {
            return eQualityLevel.Low;
        }
    }

    // 设置 当前品质等级
    private static void _SetCurLevel(eQualityLevel level)
    {
        _SetAntiAliasing(level);
        _SetResolution(level);
        _SetTexMipmapOffset(level);
        _SetShadow(level);
        _SetLODBias(level);
        _SetGraphicsTier(level);
        _SetShaderLOD(level);
        _SetGlobalShaderKW(level);
    }

    // 设置 AA
    private static void _SetAntiAliasing(eQualityLevel level)
    {
        if (level >= eQualityLevel.High)
        {
            QualitySettings.antiAliasing = srcAntiAliasing;
        }
        else
        {
            QualitySettings.antiAliasing = 0;
        }
    }

    // 设置分辨率
    private static void _SetResolution(eQualityLevel level)
    {
        // jave.lin : BRP(Built-In Rendering Pipeline) 中
        // 需要对应的 Camera 开启 AllowDynamicResolution 后才能生效
        switch (level)
        {
            case eQualityLevel.Low:
                QualitySettings.resolutionScalingFixedDPIFactor = 0.75f;
                break;
            case eQualityLevel.Middle:
                QualitySettings.resolutionScalingFixedDPIFactor = 0.85f;
                break;
            case eQualityLevel.High:
                QualitySettings.resolutionScalingFixedDPIFactor = 0.85f;
                break;
            case eQualityLevel.Ultra:
                QualitySettings.resolutionScalingFixedDPIFactor = 1.00f;
                break;
        }
    }

    // 设置 Tex 纹理 mipmap offset
    private static void _SetTexMipmapOffset(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
                QualitySettings.masterTextureLimit = DeviceAdapterLevel < eQualityLevel.High ? 3 : 2;
                break;
            case eQualityLevel.Middle:
                QualitySettings.masterTextureLimit = DeviceAdapterLevel < eQualityLevel.High ? 2 : 1;
                break;
            case eQualityLevel.High:
                QualitySettings.masterTextureLimit = 0;
                break;
            case eQualityLevel.Ultra:
                QualitySettings.masterTextureLimit = 0;
                break;
        }
    }

    // 设置阴影
    private static void _SetShadow(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
            case eQualityLevel.Middle:
                //QualitySettings.shadows = ShadowQuality.Disable; // jave.lin : 有 BUG,会导致,Animator 组件中的 culling mode 不是 always animated 的对象超出屏幕的画,会被自动停止掉
                // 所以下面使用 shadowDistance 来替代关闭
                QualitySettings.shadowDistance = 0;
                break;
            case eQualityLevel.High:
                QualitySettings.shadows = srcShadows;
                QualitySettings.shadowResolution = ShadowResolution.Low;
                QualitySettings.shadowDistance = 70;
                break;
            case eQualityLevel.Ultra:
                QualitySettings.shadows = srcShadows;
                QualitySettings.shadowResolution = ShadowResolution.High;
                QualitySettings.shadowDistance = 100;
                break;
        }
    }

    // 设置 LOD 偏移
    private static void _SetLODBias(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
                QualitySettings.lodBias = 0.5f;
                break;
            case eQualityLevel.Middle:
                QualitySettings.lodBias = 0.75f;
                break;
            case eQualityLevel.High:
            case eQualityLevel.Ultra:
                QualitySettings.lodBias = 1.0f;
                break;
        }
    }

    // 设置 GraphicsTier 的层级
    private static void _SetGraphicsTier(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
            case eQualityLevel.Middle:
                Graphics.activeTier = GraphicsTier.Tier1;
                break;
            case eQualityLevel.High:
                Graphics.activeTier = GraphicsTier.Tier2;
                break;
            case eQualityLevel.Ultra:
                Graphics.activeTier = GraphicsTier.Tier3;
                break;
        }
    }

    // 设置 Shader LOD
    private static void _SetShaderLOD(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
                Shader.globalMaximumLOD = (int)eShaderLOD.VeryLow;
                break;
            case eQualityLevel.Middle:
                Shader.globalMaximumLOD = (int)eShaderLOD.Low;
                break;
            case eQualityLevel.High:
                Shader.globalMaximumLOD = (int)eShaderLOD.Middle;
                break;
            case eQualityLevel.Ultra:
                Shader.globalMaximumLOD = (int)eShaderLOD.High;
                break;
            default:
                Shader.globalMaximumLOD = (int)eShaderLOD.UnLimit;
                break;
        }
    }

    // 设置全局Shader Keyword
    private static void _SetGlobalShaderKW(eQualityLevel level)
    {
        switch (level)
        {
            case eQualityLevel.Low:
            case eQualityLevel.Middle:
                Shader.DisableKeyword("_SOFT_PARTICLE_ON");
                break;
            case eQualityLevel.High:
            case eQualityLevel.Ultra:
                Shader.EnableKeyword("_SOFT_PARTICLE_ON");
                break;
        }
    }
}

// jave.lin : 后效基类
public class PPBasic : MonoBehaviour { }
// jave.lin : Bloom 后效
public class BloomPP : PPBasic
{
    // jave.lin : start 时 先处理,处理当前品质
    // 然后监听 品质变化的时间
    private void Start()
    {
        OnQualityLevelChanged(GameQualitySettings.GraphicsLevel);
        GameQualitySettings.onLevelChanged -= OnQualityLevelChanged;
        GameQualitySettings.onLevelChanged += OnQualityLevelChanged;
    }
    // jave.lin : 销毁时记得删除回调
    private void OnDestroy()
    {
        GameQualitySettings.onLevelChanged -= OnQualityLevelChanged;
    }

    private void OnQualityLevelChanged(eQualityLevel ql)
    {
        // jave.lin : 当 品质等级大于或等于高时,才开启 Bloom 后效
        enabled = ql >= eQualityLevel.High;
    }
}

 

 

[출처] https://blog.csdn.net/linjf520/article/details/123546253

 

Unity - 画质设置_unity systeminfo.processorfrequency 值大于5000mhz-CSDN博客

Show me Your Code, Talk Is Cheap. 以前自己写的类,现在重新写一份 代码 便于日后直接搬运使用,代码都是相当简单,都是直接调用 unity 的 API 设置即可,可以理解为就是搬运而已 环境 Unity : 2018.2.11f1

blog.csdn.net

 

반응형
Posted by blueasa
, |

Unity 2021.3.33f1

----

 

앱 최초 실행 시, 최적화를 위해 그래픽 품질 관련 자동 설정하는 기능을 찾아보다 적용하고 올려 둠.

 

참조한 글을 보니 기본적으로 유니티 SystemInfo에서 지원하는 하드웨어 스펙을 보고 판단해서 Quality Level을 메기고 있다.

해당 레벨은 Unity의 UnityEngine.QualityLevel을 참조하고 있어서 대응 하는 enum을 추가(eQualityLevel)하고,

60프레임을 사용하기 위해 해당 부분 값만 수정했다.

 

필요할 때 AutoChooseQualityLevel()을 호출하고, 반환 받은 eQualityLevel 값에 따라 원하는 설정을 적용해주면 된다.

/// <summary>
/// UnityEngine.QualityLevel에 대응하는 enum
/// </summary>
public enum eQualityLevel : int 
{
    Fastest,
    Fast,
    Simple,
    Good,       // [참고] PC(i7-10700/64GB/RTX3700)에서 Good 나옴
    Beautiful,
    Fantastic
}

private eQualityLevel AutoChooseQualityLevel()
{
    Debug.Assert(Enum.GetNames(typeof(QualityLevel)).Length == Enum.GetNames(typeof(eQualityLevel)).Length, "Please update eQualityLevel to the new quality levels.");

	var shaderLevel = SystemInfo.graphicsShaderLevel;
    var cpus = SystemInfo.processorCount;
    var vram = SystemInfo.graphicsMemorySize;
    var fillrate = 0;

    // ShaderLevel
    if (shaderLevel < 10)
    	fillrate = 1000;
    else if (shaderLevel < 20)
    	fillrate = 1300;
    else if (shaderLevel < 30)
    	fillrate = 2000;
    else
    	fillrate = 3000;
    // CPU Count
    if (6 <= cpus)
    	fillrate *= 3;
    else if (3 <= cpus)
    	fillrate *= 2;
    // VRam
    if (512 <= vram)
    	fillrate *= 2;
    else if (vram <= 128)
    	fillrate /= 2;
        
    var resx = Screen.width;
    var resy = Screen.height;
    var target_fps = 60.0f;		// 현재 게임의 타겟 프레임에 맞게 설정
    var fillneed = (resx * resy + 400f * 300f) * (target_fps / 1000000.0f);
    // Change the values in levelmult to match the relative fill rate
    // requirements for each quality level.
    var levelmult = new float[] { 5.0f, 30.0f, 80.0f, 130.0f, 200.0f, 320.0f };

    const int max_quality = (int)eQualityLevel.Fantastic;
    var level = 0;
    while (level < max_quality && fillneed * levelmult[level + 1] < fillrate)
        ++level;

    var quality = (eQualityLevel)level;
    Debug.Log(string.Format("{0}x{1} need {2} has {3} = {4} level", resx, resy, fillneed, fillrate, quality.ToString()));

    return quality;
}

 

 

P.s. 참조 글 중에 에셋도 적혀있긴한데 사서 써보진 않음.

 

 

[참조] https://stackoverflow.com/questions/20978106/automatic-quality-settings/20978462#20978462

 

Automatic quality settings

a lot of apps that I see nowadays(Android) instead of having an options screen to select the graphical level, it just automatically does it, I know this is kind of a vast question, but how can I do...

stackoverflow.com

 

[참조] https://discussions.unity.com/t/auto-detect-quality-settings/24351

 

auto detect quality settings

is there a way that unity can auto detect client GPU/CPU capability and performance to set best quality settings?

discussions.unity.com

 

[에셋] https://assetstore.unity.com/packages/tools/integration/auto-quality-hardware-assessment-tool-aqhat-74134

 

Auto Quality Hardware Assessment Tool - AQHAT | 기능 통합 | Unity Asset Store

Use the Auto Quality Hardware Assessment Tool - AQHAT from Eager Amoeba® on your next project. Find this integration tool & more on the Unity Asset Store.

assetstore.unity.com

 

반응형
Posted by blueasa
, |

[링크]

유니티 오브젝트의 null 비교 시 유의사항 1

 

유니티 오브젝트의 null 비교 시 유의사항

다음글: 유니티 오브젝트의 null 비교 시 유의사항 2

overworks.github.io

 

유니티 오브젝트의 null 비교 시 유의사항 2

 

유니티 오브젝트의 null 비교 시 유의사항 2

이전글: 유니티 오브젝트의 null 비교 시 유의사항

overworks.github.io

 

반응형
Posted by blueasa
, |

2024년 1월 16일까지(참조:https://support.google.com/admob/answer/14189727?hl=ko) Admob을 사용하려면 유저에게 GDPR 동의를 받으라고 하는 것 같다.

그래서 Google에서 관련 SDK를 내놓은게 UMP(User Messaging Platform) SDK다.

----

 

Unity GoogleMobileAds에 UMP 적용하기 위해 찾아보니 누군가가 github에 정리해 놨길래 가져와서 적당히(?) 개조해서 내 GoogleMobileAdsManager에 추가 했다.

 

[Unity-Google-UMP-Check] https://github.com/TheBossaaa/Unity-Google-UMP-Check

 

GitHub - TheBossaaa/Unity-Google-UMP-Check: Google Admob & UMP Working Script Example

Google Admob & UMP Working Script Example. Contribute to TheBossaaa/Unity-Google-UMP-Check development by creating an account on GitHub.

github.com

 

기본적으로 위 소스만 적용하고 폰에서 실행해보면 아래와 같은 에러가 나온다.

 

[Error Code] GoogleMobileAds.Ump.Api.FormError

 

해당 에러는 GoogleMobileAds Dashboard에서 GDPR 관련 설정이 안돼 있어서 나오는 에러이다.

아래 Admob UMP Docs에서는 딱히 GoogleMobileAds Dashboard 관련 설정을 설명 안해놔서 모르고 넘어갈 수 있다.

Dashboard에 설정을 하자.

애드몹 대쉬보드 - 개인 정보 보호 및 메시지 - GDPR

 

[FormError 관련 참조] https://github.com/googleads/googleads-mobile-unity/issues/2780

 

GoogleMobileAds.Ump.Api.FormError · Issue #2780 · googleads/googleads-mobile-unity

[REQUIRED] Step 1: Describe your environment Unity version: 2021.3.27f1 Google Mobile Ads Unity plugin version: 8.0.0 Platform: Android Platform OS version: Android 10 Any specific devices issue oc...

github.com

 

※ 추가적으로 Admob UMP Docs에 보면 Runtime에 GDPR 변경을 위한 버튼을 구현하는 샘플이 보인다.

    법적으로 Runtime에 GDPR 변경을 해줘야 되는거면 버튼도 별도로 추가해줘야 될 것 같다.

 

[참조] https://github.com/googleads/googleads-mobile-unity/issues/2780

 

GoogleMobileAds.Ump.Api.FormError · Issue #2780 · googleads/googleads-mobile-unity

[REQUIRED] Step 1: Describe your environment Unity version: 2021.3.27f1 Google Mobile Ads Unity plugin version: 8.0.0 Platform: Android Platform OS version: Android 10 Any specific devices issue oc...

github.com

 

[GDPR 테스트]

GDPR 테스트 관련 소스가 들어있는데, Test Device Hashed Id를 넣으라고 돼있고, 실행해보면 Logcat에 뜬다고 돼 있는데 안떠서 찾아보니 아래와 같은 내용이 있다.

(난 현재 테스트 폰이 API 30이 안돼서 Test Device Hashed Id는 안넣어도 되는 것 같다.)

 

I also struggled with the same problem. The reason NOT_REQUIRED is always returned is that the test device ID has not been registered. DebugGeography does not apply to non-test devices. In my case, even if it is a basic Android emulator, I had to register the test device ID to resolve this issue. Your emulator's device ID is displayed in logcat as follows when ConsentInformation.requestConsentInfoUpdate is called.

Use new ConsentDebugSettings.Builder().addTestDeviceHashedId("xxxxxxxxx") to set this as a debug device.

EDIT: I did more tests. It requires a test device ID since Android API 30. Until API 29, it is not necessary to specify the test device ID. I'm not sure if this is only for my development environment.

[참조] https://stackoverflow.com/questions/68529268/ump-consentstatus-always-notrequired-when-testing

 

UMP ConsentStatus always "NotRequired" when testing

I have incorporated Google's UserMessagingPlatform into my Android project for user consent to be compliant with GDPR for AdMob. The problem is that the ConsentStatus always returns "NotRequired&

stackoverflow.com

 

[GoogleMobileAdsManager에 추가된 GDPR 관련 UMP 소스]

        using GoogleMobileAds.Ump.Api;


        #region UMP(User Messaging Platform)
        /// <summary>
        /// Privacy(GDPR) 요청
        /// </summary>
        public void Request_Privacy_GDPR()
        {
            RequestConsentInfo();
        }
        
        ///Summary
        ///Request Consent Information
        ///Warning: Ads can be preloaded by the Google Mobile Ads SDK or mediation partner SDKs
        ///upon calling MobileAds.Initialize(). If you need to obtain consent from users in the European Economic Area (EEA), set any request-specific flags, such as tagForChildDirectedTreatment or tag_for_under_age_of_consent, or otherwise take action before loading ads.
        ///Ensure you do this before initializing the Google Mobile Ads SDK.
        ///Summary

        void RequestConsentInfo()
        {
            Debug.Log("[UMP] RequestConsentInfo()");

            // Set tag for under age of consent.
            // Here false means users are not under age of consent.
            ConsentRequestParameters request = new ConsentRequestParameters
            {
                TagForUnderAgeOfConsent = false,
            };

            // Check the current consent information status.
            ConsentInformation.Update(request, OnConsentInfoUpdated);
        }

        void OnConsentInfoUpdated(FormError consentError)
        {
            if (consentError != null)
            {
                // Handle the error.
                UnityEngine.Debug.LogErrorFormat("[UMP][OnConsentInfoUpdated] {0}", consentError);
                // UMP 동의 Error 시에도 초기화 진행[blueasa / 2024-03-15]
                InitializeGoogleMobileAds();
                return;
            }

            // If the error is null, the consent information state was updated.
            // You are now ready to check if a form is available.
            ConsentForm.LoadAndShowConsentFormIfRequired((FormError formError) =>
            {
                if (formError != null)
                {
                    // Consent gathering failed.
                    UnityEngine.Debug.LogErrorFormat("[UMP][LoadAndShowConsentFormIfRequired] {0}", consentError);
                    // UMP 동의 Error 시에도 초기화 진행[blueasa / 2024-03-15]
                    InitializeGoogleMobileAds();
                    return;
                }

                // Consent has been gathered.
                if (ConsentInformation.CanRequestAds())
                {
                    // UMP 동의 이후 GoogleMobileAds 초기화[blueasa / 2023-12-14]
                    // GDPR 동의 했거나, EU가 아니어도 호출되기 때문에 여기서 초기화 함.
                    InitGoogleMobileAds();
                }
            });
        }

        /// <summary>
        /// Privacy(GDPR) Button 활성화 여부 체크
        /// (설정 창에 버튼 추가함)
        /// </summary>
        public bool CheckActivePrivacyButton()
        {
            bool bActive = false;

            // EU인지 여부에 따라 버튼 활성화 체크 필요

            #region ConsentInformation.PrivacyOptionsRequirementStatus
            bActive = IsPrivacyOptionsRequirement();
            #endregion

            #region ConsentInformation.ConsentStatus
            //bActive = IsConsentForGDPR();
            #endregion

            return bActive;
        }

        public bool IsPrivacyOptionsRequirement()
        {
            // [PrivacyOptionsRequirementStatus enum 참조]
            // https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#namespace_google_mobile_ads_1_1_ump_1_1_api_1a60f41ef4f7e14d5ae1fb5f23b7e0244b
            //public enum PrivacyOptionsRequirementStatus
            //{
            //    Unknown,
            //    NotRequired,
            //    Required
            //}

            bool bIsPrivacyOptionsRequirement = false;

            // 개인정보 보호 옵션을 표시해야 하는지 여부
            switch (ConsentInformation.PrivacyOptionsRequirementStatus)
            {
                // 개인정보 보호 옵션이 표시되어야 함.
                case PrivacyOptionsRequirementStatus.Required:
                    bIsPrivacyOptionsRequirement = true;
                    break;

                // 개인정보 보호 옵션은 표시할 필요가 없음.
                case PrivacyOptionsRequirementStatus.NotRequired:
                    bIsPrivacyOptionsRequirement = false;
                    break;

                // 개인 정보 보호 옵션 요구 사항 상태를 알 수 없음.
                case PrivacyOptionsRequirementStatus.Unknown:
                    bIsPrivacyOptionsRequirement = false;
                    break;

                default:
                    bIsPrivacyOptionsRequirement = false;
                    break;
            }

            return bIsPrivacyOptionsRequirement;
        }

        public bool IsConsentForGDPR()
        {
            // [ConsentStatus enum 참조]
            // https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api#namespace_google_mobile_ads_1_1_ump_1_1_api_1aa83ad2ecf6f2a08c584b60cef06f5133
            //ConsentStatus
            //{
            //    Unknown = 0,      // Unknown consent status.
            //    NotRequired = 1,  // Consent not required.
            //    Required = 2,     // User consent required but not yet obtained.
            //    Obtained = 3      // User consent obtained, personalized vs non-personalized undefined.
            //}

            bool bIsConsentForGDPR = false;

            switch (ConsentInformation.ConsentStatus)
            {
                case ConsentStatus.Unknown:     // 동의 상태를 알 수 없습니다.
                case ConsentStatus.Required:    // 사용자 동의가 필요하지만 아직 획득되지 않았습니다.
                case ConsentStatus.NotRequired: // 동의가 필요하지 않습니다.
                    bIsConsentForGDPR = false;
                    break;

                case ConsentStatus.Obtained:    // 사용자 동의 획득, 개인화 및 비개인화 정의되지 않음.
                    bIsConsentForGDPR = true;
                    break;
            }

            return bIsConsentForGDPR;
        }

        /// <summary>
        /// Privacy(GDPR) Button 클릭해서 GDPR 동의 창 띄우기
        /// </summary>
        public void OnClickPrivacyButton()
        {
            UpdatePrivacyButton();
        }

        void PrivacyButton()
        {
            //// Enable the privacy settings button.
            //if (_privacyButton != null)
            //{
            //    _privacyButton.onClick.AddListener(UpdatePrivacyButton);
            //    // Disable the privacy settings button by default.
            //    _privacyButton.interactable = false;
            //}
        }

        private void UpdatePrivacyButton()
        {
            // Logic for updating privacy options
            ShowPrivacyOptionsForm(); // You might want to call your method to show the privacy options form here
            Debug.LogFormat("[UMP][UpdatePrivacyButton] Privacy button clicked!");
        }

        /// <summary>
        /// Shows the privacy options form to the user.
        /// </summary>
        public void ShowPrivacyOptionsForm()
        {
            Debug.Log("[UMP] Showing privacy options form.");

            // PrivacyOptionsForm 무조건 팝업으로 변경[blueasa / 2023-12-14]
            ConsentForm.ShowPrivacyOptionsForm((FormError showError) =>
            //ConsentForm.LoadAndShowConsentFormIfRequired((FormError showError) =>
            {
                if (showError != null)
                {
                    Debug.LogErrorFormat("[UMP][LoadAndShowConsentFormIfRequired] Error showing privacy options form with error: {0}", showError.Message);
                }
                else
                {
                    // 버튼 상태 갱신(필요하면)

                    // Enable the privacy settings button.
                    //if (_privacyButton != null)
                    //{
                    //    _privacyButton.interactable =
                    //        ConsentInformation.PrivacyOptionsRequirementStatus ==
                    //        PrivacyOptionsRequirementStatus.Required;
                    //}
                }

            });
        }

        void GDPRDebugger()
        {
            Debug.Log("[UMP] GDPRDebugger()");

            ///Summary
            ///Use this for debugging
            ///

            // Define the test device ID for debugging
            string testDeviceHashedId = "0B030C0B27FA3A0A7FCF5766D3BBBA1A"; // Replace with your actual test device ID

            // Create debug settings for consent testing
            var debugSettings = new ConsentDebugSettings
            {
                TestDeviceHashedIds = new List<string>
        {
            testDeviceHashedId
        }
            };

            // Set the debug geography for testing in the EEA
            debugSettings.DebugGeography = DebugGeography.EEA;
            Debug.Log("[UMP] GDPRDebugger Set : DebugGeography.EEA");

            // Set tag for under the age of consent.
            // Here false means users are not under the age of consent.
            ConsentRequestParameters request = new ConsentRequestParameters
            {
                TagForUnderAgeOfConsent = false,
                ConsentDebugSettings = debugSettings,
            };

            // Check the current consent information status.
            ConsentInformation.Update(request, OnConsentInfoUpdated);
        }
        #endregion

 

[참조] https://docs.adxcorp.kr/appendix/ump-user-messaging-platform

 

UMP (User Messaging Platform) - ADX Library

IDFA 메시지 작성은 선택사항이지만, GDPR 메시지 사용 설정을 할 경우, IDFA 메시지 작성도 같이 작성하십시오. 애드몹 UMP의 GDPR 동의 화면이 보이는 상태에서, 프로그래밍 방식으로 수동으로 ATT (AP

docs.adxcorp.kr

[사용자 메시지 플랫폼(UMP) Doc] https://developers.google.com/admob/unity/privacy?hl=ko

 

시작하기  |  Unity  |  Google for Developers

이 페이지는 Cloud Translation API를 통해 번역되었습니다. Switch to English 시작하기 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. Google EU 사용자 동의 정책에 따

developers.google.com

[GoogleMobileAds.Ump.Api Doc] https://developers.google.com/admob/unity/reference/namespace/google-mobile-ads/ump/api

 

GoogleMobileAds.Ump.Api Namespace  |  Unity  |  Google for Developers

Stay organized with collections Save and categorize content based on your preferences. GoogleMobileAds.Ump.Api Summary Enumerations ConsentStatus ConsentStatus Consent status values. Properties NotRequired Consent not required. Obtained User consent obtain

developers.google.com

[GitHub/Sample] https://github.com/googleads/googleads-mobile-unity

 

GitHub - googleads/googleads-mobile-unity: Official Unity Plugin for the Google Mobile Ads SDK

Official Unity Plugin for the Google Mobile Ads SDK - googleads/googleads-mobile-unity

github.com

 

 

반응형
Posted by blueasa
, |

Unity 2021.3.37f1

Obfuscator 3.12.0

----

 

[추가] 2024-04-15

Android - Google Play Asset Delivery로 Build 시,

nameTranslation.txt 파일을 상대경로(파일명만)로 지정했을 때 제대로 생성하지 못하는 문제가 있어서 우회하도록 수정함.

BuildReport에서 주는 빌드파일 경로를 쓰지 않고, string.Format(@"{0}/..", Application.dataPath) 로 프로젝트 패스를 쓰도록 변경함.

해당 방식을 쓰기위해 Android 일 때만, Obfuscator의 OptionsManager.cs의 LoadAssetAtPath 함수를 아래와 같이 일부 수정했다.

using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

namespace Beebyte.Obfuscator
{
    public class OptionsManager
    {
        ....
       
        private static Options LoadAssetAtPath(string path)
        {
            // [Android] nameTranslationFile Path 변경
            if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
            {
                // Custom
                Options o = AssetDatabase.LoadAssetAtPath<Options>(path);
                if (o == null)
                {
                    return null;
                }

                // 옵션값 덮어쓰지 않도록 Clone해서 사용.
                var clone_o = Object.Instantiate(o);

                /// 현재 프로젝트 절대 경로(Application.dataPath/../)로 수정 반환
                // 파일명(Default:nameTranslation.txt)만 추출해서 저장
                string strnameTranslation = System.IO.Path.GetFileName(clone_o.nameTranslationFile);
                // 현재 프로젝트 Path 적용. 절대경로값 지정
                clone_o.nameTranslationFile = string.Format(@"{0}/../{1}", Application.dataPath, strnameTranslation);
                return clone_o;
            }
            // [iOS] 기존 방식
            else
            {
                // Original
                return AssetDatabase.LoadAssetAtPath<Options>(path);
            }
        }
        
        ....
    }
}

 

 

----

Obfuscator에 난독화 기능을 쓸 때,

난독화 전/후 Naming 매칭 리스트를 뽑아주는 옵션이 있다.(아래 스샷 참조)

ObfuscatorOptions.asset

 

 

체크하면 기본 파일명이 nameTranslation.txt인데 빌드 할 때마다 덮어버리니 관리가 안돼서 빌드마다 별도로 만들어질 수 있도록 PostProcess로 파일명을 Rename 하도록 처리했다.

 

아래 소스를 프로젝트에 추가하면,

[Android] namteTranslation.txt 파일을 빌드 파일명에 매칭해서 자동으로 변경해준다.

ex) 빌드 파일명 : abc_v1.0.0.apk

      변경되는 파일명 : abc_v1.0.0.apk_ namteTranslation.txt

 

[iOS] iOS는 빌드 시점에 파일명이 지정되는게 아니라서 별도의 조합으로 진행되도록 했다.

          ex) abc_live_1.0.0(100)_20231206_183400_iOS_nameTranslation.txt

 

 

using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.Callbacks;
using System;

/// <summary>
/// [PostProcess] Obfuscator : Rename nameTranslation.txt -> {BuildFileName.ext}_nameTranslation.txt
/// </summary>
public sealed class PostProcessBuild_Obfuscator_NameTransition_Renamer : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
    public int callbackOrder => 0;

    private static readonly string m_strNameTranslation_Src = "nameTranslation";    // Obfuscator 기본값
    private static readonly string m_strExt_txt = "txt";


    public void OnPreprocessBuild(BuildReport report)
    {
        // 1. ./BUILD_PATH/nameTranslation.txt 파일 유무 체크
        // 2. 있으면 - Delete(Clear)

        string strBuildPath = string.Empty;
        string strNameTranslation_txt_Src = string.Empty;

        switch (report.summary.platform)
        {
            case BuildTarget.Android:
                {
                    // 현재 프로젝트 Path 적용(절대경로 지정)
                    // [Obfuscator-OptionsManager.cs:line 140] 연관됨
                    strBuildPath = string.Format(@"{0}/..", Application.dataPath);
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                }
                break;

            case BuildTarget.iOS:
                {
                    strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                }
                break;
        }

        if (true == File.Exists(strNameTranslation_txt_Src))
        {
            File.Delete(strNameTranslation_txt_Src);
            Debug.LogWarningFormat("[Delete] {0}", strNameTranslation_txt_Src);
        }
    }

    public void OnPostprocessBuild(BuildReport report)
    {
        Debug.LogWarningFormat("[OnPostprocessBuild][platform] {0} [pathToBuildProject] {1}", report.summary.platform, report.summary.outputPath);

        string strBuildPath = string.Empty;                 // 빌드 패스
        string strBuildFileName_with_Ext = string.Empty;    // 파일네임.확장자
        string strExt = string.Empty;                       // 확장자(.apk/.aab/.ipa)
        string strNameTranslation_txt_Src = string.Empty;   // [Src] nameTranslation.txt
        string strNameTranslation_txt_Dest = string.Empty;  // [Dest] nameTranslation.txt

        string strLunarConsole = "";
        if (true == LunarConsolePluginInternal.LunarConsoleConfig.consoleEnabled)
        {
            strLunarConsole = string.Format("_LunarConsole");
        }

        switch (report.summary.platform)
        {
            case BuildTarget.Android:
                {
                    // 현재 프로젝트 Path 적용(절대경로 지정)
                    // [Obfuscator-OptionsManager.cs:line 140] 연관됨
                    strBuildPath = string.Format(@"{0}/..", Application.dataPath);
                    //strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    strExt = Path.GetExtension(report.summary.outputPath);  // .apk / .aab
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);

                    string strProductName = string.Format("{0}", Application.productName);
                    string strServer = string.Format("{0}", ClientSettings.ServerType.ToString());
                    string strVersion = string.Format("{0}", Application.version);
                    string strBundleVersionCode = string.Format("{0}", PlayerSettings.Android.bundleVersionCode);
                    string strDateTime = string.Format("{0}", DateTime.Now.ToString("yyyyMMdd_HHmmss", System.Globalization.CultureInfo.InvariantCulture));
                    string strPlatform = string.Format("{0}", report.summary.platform);

                    strNameTranslation_txt_Dest = string.Format(@"{0}/{1}_{2}_{3}({4})_{5}{6}_{7}{8}_{9}.{10}",
                                                                    strBuildPath,               // {0}
                                                                    strProductName,             // {1}
                                                                    strServer,                  // {2}
                                                                    strVersion,                 // {3}
                                                                    strBundleVersionCode,       // {4}
                                                                    strDateTime,                // {5}
                                                                    strExt,                     // {6}
                                                                    strPlatform,                // {7}
                                                                    strLunarConsole,            // {8}
                                                                    m_strNameTranslation_Src,   // {9}
                                                                    m_strExt_txt                // {10}
                                                                    );

                    #region OutputPath 기준 방식(Google Asset Delivery 대응 안됨)
                    //strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    //strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    //strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);
                    //// Build File과 매칭하기 쉽도록
                    //// BuildFileName.ext_nameTranslation.txt 형태로 Dest 생성
                    //strNameTranslation_txt_Dest = string.Format("{0}/{1}_{2}.{3}", strBuildPath, strBuildFileName_with_Ext, m_strNameTranslation_Src, m_strExt_txt);
                    #endregion
                }
                break;

            case BuildTarget.iOS:
                {
                    strBuildPath = Path.GetDirectoryName(report.summary.outputPath);
                    strBuildFileName_with_Ext = Path.GetFileName(report.summary.outputPath);
                    strExt = Path.GetExtension(report.summary.outputPath);  // .ipa
                    strNameTranslation_txt_Src = string.Format(@"{0}/{1}.{2}", strBuildPath, m_strNameTranslation_Src, m_strExt_txt);

                    string strProductName = string.Format("{0}", Application.productName);
                    string strServer = string.Format("{0}", ClientSettings.ServerType.ToString());
                    string strVersion = string.Format("{0}", Application.version);
                    string strBuildNumber = string.Format("{0}", PlayerSettings.iOS.buildNumber);
                    string strDateTime = string.Format("{0}", DateTime.Now.ToString("yyyyMMdd_HHmmss", System.Globalization.CultureInfo.InvariantCulture));
                    string strPlatform = string.Format("{0}", report.summary.platform);

                    strNameTranslation_txt_Dest = string.Format(@"{0}/{1}_{2}_{3}({4})_{5}{6}_{7}{8}_{9}.{10}",
                                                                    strBuildPath,               // {0}
                                                                    strProductName,             // {1}
                                                                    strServer,                  // {2}
                                                                    strVersion,                 // {3}
                                                                    strBuildNumber,             // {4}
                                                                    strDateTime,                // {5}
                                                                    strExt,                     // {6}
                                                                    strPlatform,                // {7}
                                                                    strLunarConsole,            // {8}
                                                                    m_strNameTranslation_Src,   // {9}
                                                                    m_strExt_txt                // {10}
                                                                    );
                }
                break;
        }

        Debug.LogWarningFormat("[strNameTranslation_txt_Src] {0} [strNameTranslation_txt_Dest] {1}", strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
        
        // 1. ./PROJECT_PATH/nameTranslation.txt 파일 유무 체크
        // 2. 있으면 - Rename : 해당 버전명 날짜/시간 파일명에 포함
        if (true == File.Exists(strNameTranslation_txt_Src))
        {
            File.Move(strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
            Debug.LogWarningFormat("[Rename] {0} -> {1}", strNameTranslation_txt_Src, strNameTranslation_txt_Dest);
        }
        else
        {
            Debug.LogWarningFormat("[File Not Exists] {0}", strNameTranslation_txt_Src);
        }
    }
}

 

 

반응형
Posted by blueasa
, |

[링크] https://snack.planetarium.dev/kor/2020/02/thai-in-2562/

 

태국에서만 2562년으로 가는 소프트웨어?

 

snack.planetarium.dev

 

[참조] https://stackoverflow.com/questions/13903967/datetime-now-touniversaltime-has-the-wrong-year

 

DateTime.Now.ToUniversalTime() Has the Wrong Year

And Idea Why the Year appears as 2555? The culture of the site is Thai

stackoverflow.com

[참조] https://stackoverflow.com/questions/30393668/thai-year-2558-to-2015

 

Thai year 2558 to 2015

How to transform buddhist format of datetime into gregorian format (e.g. for Thailand 2558 → 2015)? using System.Text; using System.Threading; using System.Threading.Tasks; namespace

stackoverflow.com

 

반응형
Posted by blueasa
, |

[링크] https://allonsyit.tistory.com/90

 

[Jenkins] 젠킨스로 정기 작업 실행하기 / 스케줄 설정

# 젠킨스 스케줄 설정 1. 프로젝트 구성 -> 빌드 유발 -> Build periodically 선택 2. Schedule 에 크론 형식으로 시간 설정 0 8 * * * 입력 시 아래에 H 8 * * * 을 권장한다 0 8 * * * : 오전 8시 정각 H 8 * * * : 8시

allonsyit.tistory.com

 

반응형
Posted by blueasa
, |

Jenkins에서 두 브랜치를 매일 자동으로 Merge 하려고 찾아보면서 삽질하고 정리해 둠.

shall script로 해야되는건가 했는데 의외로 Jenkins에 관련 메뉴가 다 있는 것 같다.

Jenkins 메뉴로 git merge(소스 코드 관리-Merge before build 메뉴) 하고, git origin에 push(빌드 후 조치-Git Publisher 메뉴)까지 처리함.

 

----

 

To implement this task you can follow the below given steps.

  • Set your GitHub repo with credentials.

 

 

  • After that you have to set your branch name to merge. Go to source code management->Additional Behaviours->Merge before build.

 

 

  • Set your user name and user email. Go to source code management->Additional Behaviours->Custom user name and email.

 

 

Now your job is ready to merge your branch. You can also go through the below GitHub link to get more information.

https://github.com/nadim70/Newproject.git

 

GitHub - nadim70/Newproject

Contribute to nadim70/Newproject development by creating an account on GitHub.

github.com

 

 

[출처] https://www.edureka.co/community/68544/how-to-merge-two-branch-in-github-using-jenkins

 

How to merge two branch in GitHub using jenkins

Hi Everyone, I want to merge two branch in GitHub using jenkins. But I am not able to do this task. Can anyone help me to implement this task?

www.edureka.co

 

[참조] https://osc131.tistory.com/89

 

[jenkins] GIT Publisher

[jenkins] GIT Publisher 작성일자 : 2018년 10월 20일환경 : Jenkins 2.129, JDK 1.8.0_101목표 : Jenkins Build 작업 진행 후 Build에 사용됐던 GIT 버전을 Tags로 저장 ( 일종의 백업 ) * Jenkins - Git 연동 설정 및 GIT Plugin 설

osc131.tistory.com

 

반응형
Posted by blueasa
, |

[Error Log]

ERROR: Build step failed with exception
org.jenkinsci.plugins.scriptsecurity.scripts.UnapprovedUsageException: script not yet approved for use

----

To get around this, go to:
Jenkins -> Manage Jenkins -> In-process Script Approval

 

 

반응형
Posted by blueasa
, |

gradle을 Unity 2021 기본인 gradle plugin 4.0.1에서 gradle plugin 4.2.0으로 변경하고 나서

Unity Editor에서는 빌드가 잘되는데 이상하게 jenkins Android 에서만 빌드가 실패해서 삽질하면서 알아보니

jenkins를 Mac에 셋팅해뒀는데 gradle cache 폴더가 뭔가 꼬인 것 같다.

아래와 같은 Warning Log가 엄청나게 뜬다.

 

[Warning Log]

WARNING:/Users/{UserAccount}/.gradle/caches/transforms-2/files-2.1/ea30c3c071cd48c926311878c13eb08b/jetified-unity-classes.jar: D8: Expected stack map table for method with non-linear control flow.

 

그래서 아래 위치의 gradle cache 하위 있는 것들을 모두 삭제하고 새로 빌드를 실행해서 잘 돌아가는 것을 확인했다.

 

[Mac gradle cache 위치] /Users/{UserAccount}/.gradle/caches/

 

[참조] https://blueasa.tistory.com/2769

 

[플러그인] GoogleMobileAds 8.6.0(with Unity2021)

Unity 2021.3.32f1 GoogleMobileAds 8.6.0 Firebase SDK 11.6.0 ---- [추가] gradle을 Unity 2021 기본인 gradle plugin 4.0.1에서 gradle plugin 4.2.0으로 변경하고 나서 Unity Editor에서는 빌드가 잘되는데 이상하게 jenkins Android 에

blueasa.tistory.com

 

반응형
Posted by blueasa
, |