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

카테고리

분류 전체보기 (2737)
Unity3D (817)
Script (91)
Extensions (14)
Effect (3)
NGUI (77)
UGUI (8)
Physics (2)
Shader (36)
Math (1)
Design Pattern (2)
Xml (1)
Tips (200)
Link (22)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (70)
Trouble Shooting (68)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (8)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (11)
Ad (14)
Photon (2)
IAP (1)
Google (8)
Android (45)
iOS (41)
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

[문제원인]

  • 유니티에서 사용하는 C#에서 DateTime을 사용하여 달력정보를 가져올 경우 태국어에서 문제 발생.
    • 역법의 차이에서 문제가 발생.
    • 대부분의 국가는 그레고리력을 사용중이지만, 태국은 태국역법을 사용하여, 543년의 차이 발생.

         * 표준 불력은 석가모니 입적인 기원전 544년을 기준으로 사용. 태국은 이 표준불력에서 1년의 차이 발생.

  • 서버에서 내려주는 달력정보 스트링을 파싱하는 과정에서 태국어일 경우 문제 발생.
    • 스트링 포맷의 차이를 제대로 인지하지 못하고 파싱 실패. (표기 방법 상이)

 

[해결방안]

  • 클라이언트가 시스템 시간정보를 읽어 올 때, 태국어 예외 처리.

            DateTime lTime = DateTime.Now;
            if (System.Threading.Thread.CurrentThread.CurrentCulture.Name == "th-TH" 

            && Application.platform == RuntimePlatform.IPhonePlayer)
            {
                lTime = lTime.AddYears(-543);
            }

           서버에서 사용하는 그레고리력으로 통일

  • 서버에서 내려주는 달력정보의 스트링을 파싱하는 함수 변경. (포맷을 명확히 지정)

           String lCalendar = "";

           DateTime.Parse(lCalendar)  -> DateTime.ParseExact( lCalendar, "yyyy-MM-ddTHH:mm:ss.fffZ", null);

           서버에서 내려주는 포맷을 일치 시킬수 있도록 주의

 

 

반응형
Posted by blueasa
, |

Unity 를 이용해 그림판 같은 기능을 구현하는 중에 겹치는 이미지의 테두리가 흰색으로 나타나는 현상이 발생 하였다.

 

 

위 화면은 Canvas 에 검정색 원 Image 여러개가 겹쳐 있고 이를 RenderTexture 를 통해 RawImage 로 출력하고 있는 예제 이다. 사용한 이미지는 아래와 같은 설정이 되어 있다.

 

 

Scene 화면을 통해 RawImage 의 테두리 부분을 확대해 보면 다음과 같이 투명하게 처리가 되고 있는 것이 보였다.

 

 

RenderTexture 로 그려주던 Canvas 를 메인으로 돌려보면 아래와 같이 의도 했던 대로 출력이 된다.

 

 

 

1. 이미지 테두리 부분의 픽셀이 기존 픽셀과 겹쳐지면서 혹은 덮어 쓰면서 해당 픽셀을 투명하게 바꾸고 있다.

2. RenderTexture 로 변환되 RawImage 로 출력하는 과정에서 테두리 부분이 투명해 지는 현상이 일어난다.

 

1. 이미지가 문제가 있다

2. RenderTexture 가 잘못 그려주고 있다

3. RawImage 가 잘못 출력하고 있다.

 

이미지에 육안으로 확인 되지 않는 투명한(?) 부분이 있다고 가정하고 이를 보정하는 것은 어떨까? 로 시작해 쉐이더를 추가한 Material 을 추가해 보았다.

그 결과 이미지에 Sprites/Default 쉐이더를 사용하는 Material 을 사용하니 간섭 현상이 사라졌다. Material 이 추가되지 않은 이미지의 기본 쉐이더는 UI/Default 쉐이더인데 Sprites/Default 쉐이더와의 차이가 이런 현상을 만드는 것 같다.

 

UI/Default 쉐이더 코드와 Sprite/Default 쉐이더 코드를 비교하며 테스트 했더니 다음과 같이 수정해 문제 해결이 가능했다.

- UI/Default 쉐이더의  Blend SrcAlpha OneMinusSrcAlpha 값을 Blend One OneMinusSrcAlpha 값으로 변경

Blend - 투명 오브젝트를 만드는데 사용합니다.

SrcAlpha - 스테이지 값을 소스 알파 값으로 곱합니다.

One - 1값입니다. 소스 또는 대상 컬러가 완전히 표시되도록 하려면 이 값을 사용합니다.

OneMinusSrcAlpha - 스테이지 값을 (1 - 소스 알파)로 곱합니다.

 

https://docs.unity3d.com/kr/current/Manual/SL-Blend.html

 

ShaderLab: 블렌딩 - Unity 매뉴얼

블렌딩은 투명 오브젝트를 만드는 데 사용됩니다.

docs.unity3d.com

 

정리하자면 소스 알파 값이란 새로 그려진 이미지의 알파 값이고 스테이지 값은 기존 화면에 그려져 있는 값인데 이둘을 곱하면 새로 그려진 이미지의 알파값을 따라가기 때문에 이를 1값으로 변경해 새로 그려진 이미지의 알파 값을 따라가지 않게 수정 함으로써 해결 됬다고 생각한다.

 

위와 같은 문제 때문이 었다면 RenderTexture 를 통하지 않고 직접 그리는 이미지에서도 해당 상황이 재현되야 하지 않을까? 하지만 직접 그리는 이미지에서는 해당 이슈가 발생하지 않는다. 

 

RenderTexture 설정이 잘못되어 출력이 잘못 되고 있는 것은 아닐까?

RenderTexture 의 Color Format 설정을 바꿔보니 다음 두 경우에 원했던 형태의 출력이 되는 것을 확인 하였다.

RGB565 - 모든 그래픽 카드를 지원하지 않는 16 bit 텍스쳐 포멧

RGB111110Float - 모든 그래픽 카드를 지원하지 않는 포멧

https://docs.unity3d.com/ScriptReference/RenderTextureFormat.html

 

Unity - Scripting API: RenderTextureFormat

You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see: You've told us there are code samples on this page which don't work. If you know ho

docs.unity3d.com

보통의 경우 Default 값인 ARGB32 를 사용할 텐데 ... 이 방법은 아닌 것 같다.

 

RawImage 에서 출력 할 때 문제가 생기는 것은 아닐까?

https://forum.unity.com/threads/using-render-textures-on-a-ugui-image-panel-or-button.272332/

 

Using Render Textures on a uGUI Image, Panel or Button?

Hello! I'm trying to put my minimap into the uGUI system. Is it possible to get a Render Texture working with these? I've got my render texture...

forum.unity.com

관련 이슈로 토론한 흔적이 보인다. 여기서 찾은 방법은 UI/Default 쉐이더에서 알파 클립을 제거한 커스텀 쉐이더를 RawImage 에 붙여 해결한 것이다. 쉐이더 코드를 보면 강제로 알파 값을 1로 만들어 주는 역활을 하고 있다.

UI-Default-No-Alpha.shader
0.00MB

 

여지껏 시도해 봤던 방법 중에 커스텀 쉐이더를 RawImage 에 적용하는 방법이 제일 괜찮아 보여 일단은 이것으로 해결. 왜 저러는 건지에 대해서는 좀더 찾아봐야 될듯...



출처: https://ukprog.tistory.com/56 [Vader87]

 

[Unity3D] RenderTexture RawImage 출력 이슈

Unity 를 이용해 그림판 같은 기능을 구현하는 중에 겹치는 이미지의 테두리가 흰색으로 나타나는 현상이 발생 하였다. 위 화면은 Canvas 에 검정색 원 Image 여러개가 겹쳐 있고 이를 RenderTexture 를 ��

ukprog.tistory.com

 

반응형
Posted by blueasa
, |

IOException: Sharing violation on path ..\Temp\StagingArea\assets\bin\Data\Managed\tempStrip\Firebase.Analytics.dll

 

빌드하다가 못보던 dll 관련 빌드 에러가 나서 확인해보니 백신 관련 문제였다.

백신에서 해당 프로젝트 폴더를 예외처리 하던지, 백신을 잠시 끄자.

 

 

[참조]

Answer by timkeosa · '17년 Jul월 25일 PM 06시 04분

I encountered a very similar issue and found it was caused by the antivirus software. By suspending the antivirus process, I was able to work around the problem.

Try configuring your AV to "exclude" your project directory, but if that fails then you'll need to either disable or temporarily suspend the AV's process.

 

 

[출처] https://answers.unity.com/questions/1381688/ioexception-sharing-violation-on-path-after-build.html

 

IOexception: Sharing violation on path after build - Unity Answers

 

answers.unity.com

 

반응형
Posted by blueasa
, |

[Error Message]

This release is not compliant with the Google Play 64-bit requirement

The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: 93.

Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app.

https://developer.android.com/distribute/best-practices/develop/64-bit

 

[Answer]

For those who have this problem since yesterday (August 19, 2019):

In Player Settings > Other Settings you must now uncheck the x86 box (It is for the 32-bit Intel architecture).


You will now only have the following warning:

The device types on which your application can be installed will be more restricted.

But, in my case, it drops from 12392 devices to 12385 devices.

Here is the opinion of a Unity member on the issue:

x86 is used by less than 0.4% of all Android devices, so it shouldn't have any real impact.

x86 target will be removed completely in Unity 2019.3.

 

[출처]

https://stackoverflow.com/questions/57332053/unity-aab-not-compliant-with-the-google-play-64-bit-requirement

 

Unity aab not compliant with the Google Play 64-bit requirement

I have a Unity project that I'm switching from APKs to AABs (app bundles). Previously, when I was building it as an APK, the Google Play Console told me the APK was 64-bit compliant. Now that I'm

stackoverflow.com

 

반응형
Posted by blueasa
, |

[에러메시지]

DllNotFoundException: FirebaseCppApp-6_9_0
Firebase.AppUtilPINVOKE+SWIGExceptionHelper..cctor () (at Z:/tmp/tmp.G7nHbBPBcF/firebase/app/client/unity/proxy/AppUtilPINVOKE.cs:117)

....(하략)....

 

 

유니티에서 플러그인을 어느 플랫폼에 사용할 지 셋팅하는 인스펙터 창에 보이는 'Any Platform'이 신뢰하기 힘든 동작을 하는 것 같다.

이 번에 한바탕 한 플러그인은 FirebaseCppApp-6_9_0이다.

아래와 같이 'Any Platform'을 체크하고, 내 자리에서 제대로 동작하는 걸 확인하고 Commit을 했는데 다른 자리에서 제대로 인식을 하지 못한다.

 

Any Platform 체크

 

그래서 'Any Platform'을 해제하고 개별적으로 모두 체크하니 제대로 동작한다.

개별적으로 Platform 모두 체크

 

'Any Platform' 체크를 사용하지 말아야겠다.

반응형
Posted by blueasa
, |

[에러메시지]

Resolution failed

Failed to fetch the following dependencies:
com.google.firebase:firebase-analytics:17.2.1
com.google.firebase:firebase-analytics-unity:6.9.0
com.google.firebase:firebase-common:19.3.0
com.google.firebase:firebase-app-unity:6.9.0
com.crashlytics.sdk.android:crashlytics:2.9.9
com.google.firebase:firebase-crashlytics-unity:6.9.0
com.google.android.gms:play-services-appinvite:18.0.0
com.google.firebase:firebase-dynamic-links-unity:6.9.0
com.google.firebase:firebase-messaging:20.1.0
com.google.firebase:firebase-messaging-unity:6.9.0
com.google.firebase:firebase-config:19.0.4
com.google.firebase:firebase-config-unity:6.9.0
com.google.android.gms:play-services-ads:18.3.0

 

[해결방법]

환경변수에 JAVA_HOME이 설정.

(새 컴퓨터 셋팅하면서 OpenJDK는 넣었는데 JAVA_HOME 설정을 안해서 생긴 문제)

 

 

 

[해결책 출처]

wagner32 commented on 28 Jan 2019

@srcsameer @MDReptile @GiorgioTurro i know the solusion just make "JAVA_HOME"
like this

https://user-images.githubusercontent.com/47056856/51804757-5f8d1b80-2297-11e9-90b8-e09ace2c17af.png

 

 

 

 

Aadd 'JAVA_HOME'

 

[출처]

https://github.com/playgameservices/play-games-plugin-for-unity/issues/2116

 

Resolution Failed!!! Please help. · Issue #2116 · playgameservices/play-games-plugin-for-unity

Hi! guys in my project i already have AdMob plugin installed and i am trying to add play-games-plugin-for-unity when i clicked to import GooglePlayGamesPlugin-0.9.50 it started to import in unity. ...

github.com

 

반응형
Posted by blueasa
, |

Windows7 64bit

Unity 2018.4.13f1

Firebase 6.9.0

 

Firebase 6.9.0 넣고 나온 또 다른 빌드 에러..


CommandInvokationFailure: Gradle build failed. 

...

stderr[

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':packageRelease'.
> 1 exception was raised by workers:
  java.io.UncheckedIOException: java.io.IOException: Failed to obtain compression information for entry

 


해결책은 아래와 같다.

Minify-Release/Debug가 기본 None인데, 업데이트 되면서 값을 넣어야 되나보다.

Proguard 이야기도 있긴한데, 우선 아래 보이는대로 Gradle (Experimental) 로 바꾸니 빌드가 잘 된다.

 


 

Someone in the thread from unity forum finally posted a working solution. I'm gonna share it here as well so hopefully everyone who lands on the question with this issue will not have to spend 30 hours blindfolded, resolving dex merging conflicts like I did.

Turns out that with new new version there is a few more options in the publish settings that needs to be set!

quoting RealPpTheBest s' answer

Go to player settings > Project Settings > Minify, in there, there will be an option of Release, set it to Gradle .

For some reason when choosing gradle build these two are not automatically toggled, and maybe in some cases they don't have to be. But setting minify to Grable (experimental) completely resolved all the build errors I was getting after updating unity.

EDIT: september-2019 - Solution above should still work, but:

I have lately been experimenting with choosing Proguard instead of the experimental Gradle minifier (can be selected in the dorpdown as well). When configured correctly proguard will also resolve your DEX limitation errors, and get rid of unused code and even compress your build size even more.

This post has a quite throughly detailed guide on how to enable and configure it. Keep in mind though, that the configuration will be unique to which dependencies you are using, so you will have to read up and do some custom configuration here most likely.

shareedit

edited Sep 26 '19 at 7:39

 

answered Jun 24 '19 at 15:46

Rasmus Puls

8996 silver badges19 bronze badges

 

[출처]

https://stackoverflow.com/questions/56623107/unity-gradle-build-error-while-merging-dex-archives/58012656#58012656

 

Unity gradle build - Error while merging dex archives

I'm trying to compile my project using "Build App Bundle (Google Play)" for the first time. However I am getting an error while merging dex archives. I believe it is due to some of my plugins are u...

stackoverflow.com

 

[참조]

https://forum.unity.com/threads/gradle-shenanagains.602599/

 

Gradle Shenanagains?

Honestly, I have no idea what's going wrong here. CommandInvokationFailure: Gradle build failed. C:\Program...

forum.unity.com

 

 
반응형
Posted by blueasa
, |

OS : Windows7 64bit

Unity : 2018.4.13f1

Firebase : 6.9.0


Generation of the Firebase Android resource file google-services.xml from Assets/Firebase/google-services.json failed.
If you have not included a valid Firebase Android resources in your app it will fail to initialize.
"C:\Project\git\ProjectName\Assets\Firebase\Editor\generate_xml_from_google_services_json.exe" -i "Assets/Firebase/google-services.json" -l

Traceback (most recent call last):
  File "", line 446, in 
  File "", line 289, in main
  File "", line 228, in argv_as_unicode_win32
AttributeError: 'module' object has no attribute 'wintypes'
generate_xml_from_google_services_json returned -1


Firebase 6.9.0을 유니티에 Import하고 위와 같은 에러를 보게 됐다.

결론적으로 wintypes attribute가 없다는 말인데 저게 뭔지 몰라서 한참 찾아 헤메다가

아래 링크에서 답을 찾았다.

 

[해결방법] 원본 (https://github.com/firebase/quickstart-unity/issues/540)

[해결방법] Detail (https://github.com/firebase/quickstart-unity/issues/540)

 

결론적으로 Firebase 6.9.0이 Windows7을 제대로 지원하지 않는 것 같다.

그래서 generate_xml_from_google_services_json.exe 파일을 다시 컴파일하는 작업을 위해서 설명하고 있다.

Python 2.7이 필요한데, Python 2.7.9 이상을 설치해야 pip가 Python에 기본적으로 들어 있다.

나는 아래 링크의 2.7.17을 깔았다.

 

[Python 2.7.17 다운로드] https://www.python.org/downloads/release/python-2717/

 

해결방법 Detail 설명대로 다하고나니 이제 에러가 뜨지 않는다.

 

 

P.s. Windows7 지원 종료가 되면서 여기저기 다른 곳에서도 지원을 종료하면서 개발에 피해가 오고 있는 걸 체감하고 있다.

    현재 피해 당하고 있는 건 SourceTree와 Firebase..-_-

 

 
반응형
Posted by blueasa
, |

최근에 안드로이드 프로젝트 컴파일 시 오류가 발생했습니다.

구글링으로 이것 저것 같아 보았는데, compileSdkVersion 와 com.android.support:appcompat-v7을 28로 올리면 해결된다는 글이 많았습니다. 

그래서 원인을 찾아보고 해결 방법을 찾았습니다.

 

[오류]

error: resource android:attr/fontVariationSettings not found.

Message{kind=ERROR, text=error: resource android:attr/fontVariationSettings not found., 

sources=[C:\*****\*****\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4fbc79d932923de1fd1d9a6e9b479d50\res\values\values.xml:246:5-69], original message=, tool name=Optional.of(AAPT)}

 

error: resource android:attr/ttcIndex not found.

Message{kind=ERROR, text=error: resource android:attr/ttcIndex not found., 

sources=[C:\*****\*****\.gradle\caches\transforms-1\files-1.1\appcompat-v7-26.1.0.aar\4fbc79d932923de1fd1d9a6e9b479d50\res\values\values.xml:246:5-69], original message=, tool name=Optional.of(AAPT)} 

 

[원인]

 애드몹의 SDK 최신 버전이 18로 이번주에 배포 되어 있는데, 이 SDK의 경우 Android API 28(안드로이드 9) 에서 최적화 된듯 합니다.

gradle의 dependencies에서 최신의 애드몹 SDK를 참조하고 있고, Andorid API가 27 이하인 경우에 발생합니다.

 

[해결]

 모듈 gradle에서 참조하고 있는 애드몹의 SDK의 버전을 17로 설정하면 컴파일 오류가 해결됩니다.

 

(변경전) 

implementation 'com.google.android.gms:play-services-ads:+'

(변경후)

implementation 'com.google.android.gms:play-services-ads:17+'

 



출처: https://docko.tistory.com/entry/안드로이드-오류-error-resource-androidattrfontVariationSettings-ttcIndex-not-found [장똘]

 

안드로이드 오류 - error: resource android:attr/fontVariationSettings & ttcIndex not found.

최근에 안드로이드 프로젝트 컴파일 시 오류가 발생했습니다. 구글링으로 이것 저것 같아 보았는데, compileSdkVersion 와 com.android.support:appcompat-v7을 28로 올리면 해결된다는 글이 많았습니다. 그래서..

docko.tistory.com

 

반응형
Posted by blueasa
, |

Unity에서 Firebase Cloud Messaging(FCM) 서비스 적용 후 빌드 시, 애플로부터 Missing Push Notification Entitlement 메시지를 받을 때가 있는데 어느 순간 부터 XCode에서 Capabilities-Push Notifications를 수동으로 ON 시켜줘야 된단다.

 

 

[참조]

7단계: 사용자 알림 프레임워크 추가

  1. Xcode 프로젝트를 클릭한 후 Editor area(편집 영역)에서 General(일반) 탭을 클릭합니다.

  2. Linked Frameworks and Libraries(연결된 프레임워크 및 라이브러리)까지 아래로 스크롤한 다음 + 버튼을 클릭하여 프레임워크를 추가합니다.

  3. 나타나는 창에서 UserNotifications.framework까지 스크롤하여 해당 항목을 클릭한 다음 Add(추가)를 클릭합니다.

8단계: 푸시 알림 사용 설정

  1. Xcode 프로젝트를 클릭한 후 Editor area(편집 영역)에서 Capabilities(기능) 탭을 클릭합니다.

  2. Push Notifications(푸시 알림)를 On(켜기)으로 전환합니다.

  3. Background Modes(백그라운드 모드)까지 아래로 스크롤하고 On(켜기)으로 전환합니다.

  4. Background Modes(백그라운드 모드)아래의 Remote notifications(원격 알림) 체크박스를 선택합니다.

 

[출처] https://firebase.google.com/docs/cloud-messaging/unity/client?hl=ko

 

Unity로 Firebase 클라우드 메시징 클라이언트 앱 설정  |  Firebase

Unity로 교차 플랫폼 Firebase 클라우드 메시징 클라이언트 앱을 작성하려면 Firebase 클라우드 메시징 API를 사용하세요. Unity SDK는 Android 및 iOS에서 모두 작동하며 플랫폼에 따라 몇 가지 추가 설정이 필요합니다. 시작하기 전에 1단계: 환경 설정 Unity 5.3 이상을 설치합니다. (iOS만 해당) 다음에 대한 액세스 권한이 있어야 합니다. Xcode 9.4.1 이상 CocoaPods 1.4.0 이상 Unity 프로젝

firebase.google.com

 

반응형
Posted by blueasa
, |