블로그 이미지
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-24 00:01

[사용엔진] Unity 2021.3.9f1

 

Unity 2021을 설치하고 Android 빌드를 하니 빌드 파일 위치에 'BuildFileName_BackUpThisFolder_ButDontShipItWithYourGame'라는 폴더가 생긴다.

 

난 프로젝트 메인 위치에 빌드 파일 생성하게 하다보니 'BuildFileName_BackUpThisFolder_ButDontShipItWithYourGame' 폴더가 git이 인식하는 위치에 생성되는데다

BuildFileName을 계속 넘버링하면서 만들다보니 위의 폴더도 계속 생성된다.

 

  [문제점]

1. 폴더가 파일명에 맞게 계속 생성돼서 계속 많아진다.(SSD/HDD 용량이슈 등)

2. 생성되는 폴더 위치가 git 관리 영역이라 git에 생성된 파일로 보여서 문제가 생긴다.(파일 갯수도 많음)

 

그래서 유니티에 생성 안하게 하는 옵션이 없나하고 검색해 봤지만 별시리 없는 것 같고..

계속 검색하다보니 PostprocessBuild로 해당 폴더를 삭제 해버리는 방식을 사용하는 포스팅을 보고 적용해서 잘되는 것을 확인하고 올려 둔다.

 

[해결방법]

- 아래 Script를 Editor 폴더에 넣자~

 

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

public sealed class WindowsIL2CPPBuildBackUpThisFolderDeleter : IPostprocessBuildWithReport
{
    public int callbackOrder => 0;
    // 확정된 폴더명은 readonly 변수로 만듬
    private readonly string m_strBackUpThisFolder_ButDontShipItWithYourGame = "BackUpThisFolder_ButDontShipItWithYourGame";

    public void OnPostprocessBuild(BuildReport report)
    {
        var summary = report.summary;
        var platform = summary.platform;

        if (platform != BuildTarget.StandaloneWindows 
            && platform != BuildTarget.StandaloneWindows64
            && platform != BuildTarget.Android  // Android 플랫폼에서도 작동하도록 추가
            && platform != BuildTarget.iOS)     // iOS 플랫폼에서도 작동하도록 추가
        {
            return;
        }

        if (summary.options.HasFlag(BuildOptions.Development))
        {
            return;
        }

        var outputPath = summary.outputPath;
        var outputDirectoryPath = Path.GetDirectoryName(outputPath);
        
        // 빌드 폴더 이름이 FileName을 따라가서 FileName을 폴더명으로 쓰도록 수정
        var outputFileName = Path.GetFileNameWithoutExtension(outputPath);
        //var productName = PlayerSettings.productName;

        var backUpThisFolderPath = $"{outputDirectoryPath}/{outputFileName}_{m_strBackUpThisFolder_ButDontShipItWithYourGame}";

        if (!Directory.Exists(backUpThisFolderPath))
        {
            return;
        }

        Directory.Delete(backUpThisFolderPath, true);
    }
}

 

아래 참조한 포스팅의 스크립트는 Windows에서 Android 플랫폼 빌드를 했을때 처리가 안되고,

BuildFileName을 제대로 찾지 못해서 스크립트 내용 중 일부를 수정해서 제대로 삭제하는 것까지 확인함.

 

[추가 처리]

혹시 몰라서 git에 잘못 올라가지 않도록, git ignore list에 아래와 같이 추가 해놓음.

[git ignore list 추가] *_BackUpThisFolder_ButDontShipItWithYourGame/

 

 

[참조] https://baba-s.hatenablog.com/entry/2022/02/08/090000

 

【Unity】Windows IL2CPP ビルドした時に生成される XXXX_BackUpThisFolder_ButDontShipItWithYourGame を自動で削

ソースコード using System.IO; using UnityEditor; using UnityEditor.Build; using UnityEditor.Build.Reporting; public sealed class WindowsIL2CPPBuildBackUpThisFolderDeleter : IPostprocessBuildWithReport { public int callbackOrder => 0; public void OnPo

baba-s.hatenablog.com

 

반응형
Posted by blueasa
, |

[사용엔진] Unity 2020.3.37f1

-------------------------------------------------------------------------------------------

[추가]

Push 관련해서 같은 에러가 나서 확인해보니 아래 링크와 같은 처리를 요구하고 있다.

 

1. Android 12 이상에 대해서 PendingIntent 를 PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE 추가

2. AndroidManifest.xml  SCHEDULE_EXACT_ALARM 퍼미션 추가

<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

>> 1.2. 둘다 처리가 필요할 듯 하다.

 

 

[참조] https://github.com/radishmedia/react-native-push-notification/pull/19

 

fix: fix for not receiving notification on android 12 by tjkang · Pull Request #19 · radishmedia/react-native-push-notificatio

Description 안드로이드에서 sdk version 을 31 로 업그레이드하고 compileSdkVersion = 31 targetSdkVersion = 31 notification 이 수신이 안되는 이슈입니다 이는 안드로이드 12 이상에 대해서 PendingIntent 를 PendingIntent.F

github.com

-------------------------------------------------------------------------------------------

 

구글에서 API 31을 쓰라고 해서 Target API를 31로 올리고 빌드 했는데,

실행은 되지만 최신 폰(좀 안좋은 폰은 정상)에서 실행 중 아래와 같은 에러메시지를 띄우면서 크래시가 남.

----

AndroidJavaException: java.lang.IllegalArgumentException: com.xxx.xxx.xxx: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
    java.lang.IllegalArgumentException: com.xxx.xxx.xxx: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

----

이리저리 찾아보니 크게 2가지 처리를 하는 것 같다.

1. AndroidManifest.xml에 exported 명시적으로 설정

2. gradle의 dependencies {}에 androidx.work:work-runtime:2.7.0 라이브러리 추가(for Java)

    - 2.7.0부터 Android 12(API31)대응을 해서 2.7.0이상을 추가하면 되는 듯

    - Unity는 mainTemplate.gradle의 dependencies {...}에 추가

    - 라이브러리 선택 사항

       = [Java] implementation 'androidx.work:work-runtime:2.7.0'  // for Unity

       = [Kotlin] implementation 'androidx.work:work-runtime-ktx:2.7.0

 

 

내 경우는 exported 관련은 이미 돼 있어서 아래와 같이 androidx.work:work-runtime:2.7.1(현재 기준 공식 최신버전)을 추가하고 해결 했다.

mainTemplete.gradle

    dependencies{

    ....

    implementation 'androidx.work:work-runtime:2.7.1'    // for Java

    ....

    }

 

[참조] https://textbox.tistory.com/entry/android-%EC%8B%A4%ED%96%89%EC%98%A4%EB%A5%98-version-31%EC%97%90%EC%84%9C-%EC%95%B1-%EC%8B%A4%ED%96%89%EC%8B%9C-%EC%98%A4%EB%A5%98

[참조] https://bacassf.tistory.com/166

[참조] https://onlyfor-me-blog.tistory.com/467

[참조] https://stackoverflow.com/questions/68228666/targeting-s-version-10000-and-above-requires-that-one-of-flag-immutable-or-fl

반응형
Posted by blueasa
, |

[링크]

https://afsdzvcx123.tistory.com/entry/C-%EB%AC%B8%EB%B2%95-C-%EB%AC%B8%EC%9E%90%EC%97%B4%EC%97%90%EC%84%9C-%EA%B3%B5%EB%B0%B1%EB%9D%84%EC%96%B4%EC%93%B0%EA%B8%B0-%EC%B2%B4%ED%81%AC%ED%99%95%EC%9D%B8-%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95

 

[C# 문법] C# 문자열에서 공백(띄어쓰기) 체크(확인) 하는 방법

안녕하세요. 오늘은 C# 문법으로 문자열에서 공백, 띄어쓰기가 중간에 포함되어 있는지 확인하는 방법에 대해서 알려드리고자 합니다. 예제코드를 통하여 바로 알아볼게요!^^ 예제 코드 1 2 3 4 5 6

afsdzvcx123.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://blog.naver.com/kbnavi/220063172641

 

엑셀 중복체크 간단하게 처리하기(조건부서식, COUNTIF함수)

안녕하세요. 점심으로 순대국을 시원하게 해치운 백넘버9 입니다. 오전부터 친구녀석이 엑셀에서 중복체크...

blog.naver.com

 

반응형
Posted by blueasa
, |

[링크] https://developer-talk.tistory.com/326

 

[C#]List 특정 값 존재하는지 체크하는 방법

이번 포스팅은 C#의 List에서 특정 값이 존재하는지 체크하는 방법을 소개합니다. 목차 Contains() 함수 Exists() 함수 FindIndex() 함수 데이터 형식이 객체인 List Contains() 함수 Contains() 함수 구문은 다..

developer-talk.tistory.com

 

반응형
Posted by blueasa
, |