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

카테고리

분류 전체보기 (2825)
Unity3D (875)
Script (92)
Extensions (16)
Effect (3)
NGUI (81)
UGUI (9)
Physics (2)
Shader (37)
Math (1)
Design Pattern (2)
Xml (1)
Tips (202)
Link (24)
World (1)
AssetBundle (25)
Mecanim (2)
Plugins (83)
Trouble Shooting (71)
Encrypt (7)
LightMap (4)
Shadow (4)
Editor (12)
Crash Report (3)
Utility (9)
UnityVS (2)
Facebook SDK (2)
iTween (3)
Font (18)
Ad (14)
Photon (2)
IAP (1)
Google (11)
URP (4)
Android (51)
iOS (46)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (236)
협업 (64)
3DS Max (3)
Game (12)
Utility (140)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (52)
Android (16)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (19)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

Untiy 2021.3.14f1

GoogleMobileAds 7.3.0

----

 

Unity 2021로 엔진 업데이트를 하고 빌드해보려는데 에러가 나서 보니 GoogleMobileAds 7.3.0 관련 이슈인 것 같다.

(GoogleMobileAds 7.2.0은 빌드 잘됨)

검색해보니 아래와 같은 해결책이 나온다.

 

- 간단히 말하면 Unity 2021에서 GoogleMobileAds 7.3.0을 쓰려면 gradle 버전 업데이트 하라고 한다. (아래 내용 따라하라고 함)

- 그래서 난 일단 GoogleMobileAds 7.2.0으로 버전을 내렸다(?)

 

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

·8 mo. ago·edited 8 mo. ago

Yo so I found a way to solve this, assuming you are using applovin or charboost , what I did was:

  • Delete resolved libraries : Assets> External Dependancy Manager > Android resolver > Delete resolve libs
  • in player settings > pulishing settings uncheck all the one under build
  • Download gradle 6.9
  • Prefrences > external tools > uncheck gradle and browse to the installed gradle
  • Assets> External Dependancy Manager > Android resolver > Force resolve
  • then player settings > pulishing settings check all the ones you uncheck plus Custom Base Gradle Template
  • edit the file Asstes\Plugins\Android\baseProjectTemplate.gradle
  • change target api level to 31
  • change the line that looks like classpath 'com.android.tools.build:gradle:yourversion' to classpath 'com.android.tools.build:gradle:4.2.0'

Build now it works. the funny thing is that gradle is 6.9 and com.adroid.tools.build:gradle: is 4.2.0 but it works.

[출처] https://www.reddit.com/r/Unity3D/comments/tktc13/i_need_help_asap/

 

I NEED HELP ASAP

**Hello everyone. I've been trying to build my game but I get these errors:** *...

www.reddit.com

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

Hello. I solved my problem this way.
Download the latest Gradle version here.
https://gradle.org/releases/

Place the unzipped Gradle file in the following location
/Applications/Unity/Hub/Editor/2021.3.12f1/PlaybackEngines/AndroidPlayer/Tools/gradle/
Please note that 2021.3.12f1 is the editor version and should be replaced with your own environment.

Next, open Unity and change the Gradle to be used.
From the top menu, select Unity > Preferences and open External Tools.

Uncheck the box marked "Gradle Installed with Unity (recommended)" and enter the path to the Gradle you just placed.

Now the Gradle used for building has been switched to a different version.
If there are no problems with the version, you should now be able to build Android.

 

[출처] https://github.com/googleads/googleads-mobile-unity/issues/2390

 

This feature requires ASM7 · Issue #2390 · googleads/googleads-mobile-unity

[REQUIRED] Step 1: Describe your environment Unity version: 2021.3.12f1 Google Mobile Ads Unity plugin version: 7.3.0 Platform: Unity Editor Platform OS version: Android 12 Any specific devices iss...

github.com

 

반응형
Posted by blueasa
, |

[Error] Error building Player: Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed, please move your resources to an AAR or an Android Library. See ""AAR plug-ins and Android Libraries"" section of the Manual for more details.

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

Unity 2020에서 Unity 2021로 올리고 빌드해보니 위와 같은 에러가 나온다.

Unity 2021부터 res 폴더가 Obsolete 된 건 알고 있었는데, assets 폴더도 Obsolete 됐나 보다.

가능하면 제거하는 쪽으로 하고, 써야 된다면 아래 [링크]를 참조하자.

 

[링크] https://codetime.tistory.com/575

 

[Unity 2021/Android/Exception] OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed 처리

OBSOLETE - Providing Android resources in Assets/Plugins/Android/assets was removed ※ 빈 안드로이드 프로젝트에서 빈 라이브러리를 빌드한 뒤 결과 aar 파일을 압축 해제하여 res, assets 폴더를 넣고 다시 aar로 압축

codetime.tistory.com

 

[참조] Unity 2021부터 res 폴더도 Obsolete 되면서 이전에 사용하던 app_name 로컬라이징 이슈도 발생한다.

[참조 링크] https://blueasa.tistory.com/2659

 

[Android][빌드에러] Exception: OBSOLETE - Providing Android resources in Assets/Plugins/Android/res was removed

Unity 2021.3.11f1 I2 Localization(app_name 로컬라이징 용도) I2 Localization 에셋으로 app_name Localization을 하고 있었는데, Unity 2021.3.11f1으로 업데이트 한 후에 Android에서 로컬라이징이 되지 않고 기본 설정된 Ap

blueasa.tistory.com

 

반응형
Posted by blueasa
, |

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

 

android 12 변경 사항 정리

이 글은 아래 사이트를 학습하며 작성한 글입니다. https://developer.android.com/about/versions/12/behavior-changes-all?hl=ko 모든 앱 동작 변경 사항 모든앱 동작 변경 사항이란? targetSdkVersion과 관계없이 Android 12

als2019.tistory.com

 

반응형
Posted by blueasa
, |

Android 7(API 24) 이상에서 지원하는 멀티 윈도우를 막으려면 AndroidManifest.xml에 android:resizeableActivity="false"만 추가하면 됐는데,

위 방식은 API 30까지만 가능하고 API 31(Android 12)부터는 화면이 크면 경고는 뜨지만 막히지 않는다.

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

 

[펌] How can I disable multiwindow mode for an Activity in Android N+

In your manifest, you need: android:resizeableActivity="false" So in your manifest file, for each activity that you want to disable the feature in, it would be like: Or, if you want to disable it in your entire app: . . . As for what will happen, Android j

blueasa.tistory.com

[참조2] https://developer.android.com/guide/topics/large-screens/multi-window-support

 

멀티 윈도우 지원  |  Android 개발자  |  Android Developers

멀티 윈도우 지원 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 멀티 윈도우 모드를 통해 여러 앱이 같은 화면을 동시에 공유할 수 있습니다. 시스템에서

developer.android.com

 

그래서 약간 꼼수로 아래와 같이 처리했다.

 

[차단]

멀티윈도우/팝업윈도우로 갈 때 OnApplicationPause가 작동하기 때문에, OnApplicationPause에서 false 일 때(Pause가 풀릴 때) , Screen의 현재 해상도를 체크해서 내가 사용하는 게임 비율이 아니면 차단하게 함.

    Ex) 가로모드 게임이면, height가 width보다 크면 차단

 

[해제]

멀티윈도우/팝업윈도우에서 정상적인 전체화면 게임으로 돌아와도 OnApplicationPause가 Call 되지 않기 때문에 여기서 처리는 불가능한 걸 확인했다.

그래서 [차단] 할 때, InvokeRepeating을 사용해서 주기적으로 체크(Update를 쓰면 평소에도 Call 되기 때문에 Invoke 사용함)해서 해상도가 내가 사용하는 비율이 맞으면 해제하도록 해놓음.

  Ex) 가로모드 게임이면, width가 height보다 크먼 해제

 

대충 아래와같이 구현해 둠..

void OnApplicationPause(bool _bPaused)
{
    Debug.LogFormat("[OnApplicationPause] {0}", _bPaused);
    // Android에서만 처리하기 위해 Define으로 분기
#if !UNITY_EDITOR && UNITY_ANDROID
    OnApplicationPause_Android(_bPaused);
#elif !UNITY_EDITOR && UNITY_IOS
#endif
}

void OnApplicationPause_Android(bool _bPaused)
{
    // Pause 할 때는 Pass
    if (true == _bPaused)
        return;

    // [Android12(API31) 멀티윈도우 차단
    // Pause 해제 시, 해상도 세로가 가로보다 더 길면 차단(가로모드 게임)
    if (Screen.currentResolution.width <= Screen.currentResolution.height)
    {
        // [Active] UnSupported Resolution Popup
        // (화면을 완전히 가리고, 터치가 안되도록 Collider를 넣음)
        ActivateUnsupportedResolutionPopup(true);

        // 차단 해제 체크용(Update는 항상 돌기 때문에 Invoke로 필요할때만 처리)
        InvokeRepeating("UpdateCheckUnSupportedResolution", 0.1f, 0.1f);
    }
}

void UpdateCheckUnSupportedResolution()
{
    // 해상도가 가로모드 해상도에 맞게 돌아오면 차단 팝업 해제 및 CancelInvoke
    if (Screen.currentResolution.height < Screen.currentResolution.width)
    {
        // [InActive] UnSupported Resolution Popup
        SGT.UIMain.ActivateUnSupportedResolutionPopup(false);

        CancelInvoke("UpdateCheckUnSupportedResolution");
    }
}
반응형
Posted by blueasa
, |

In your manifest, you need:

android:resizeableActivity="false"

So in your manifest file, for each activity that you want to disable the feature in, it would be like:

<activity android:name=".SomeActivity"
    android:label="@string/app_name"
    android:resizeableActivity="false" />

Or, if you want to disable it in your entire app:

<application 
   android:resizeableActivity="false" >
    . . .
</application>

As for what will happen, Android just won't let your app go into multi-screen mode - it will just stay full screen. See https://developer.android.com/preview/features/multi-window.html and https://developer.android.com/guide/topics/manifest/activity-element.html#resizeableActivity.

 

[링크] https://stackoverflow.com/questions/37311145/how-can-i-disable-multiwindow-mode-for-an-activity-in-android-n

 

How can I disable multiwindow mode for an Activity in Android N+

In the developer preview for Android N, multi-window support is enabled by default. How can I disable it for activites? Also what will happen if a multi-window enabled app launches my disabled ac...

stackoverflow.com

[참조] https://50billion-dollars.tistory.com/entry/Android-%EB%8B%A4%EC%A4%91-%EC%B0%BD-%EB%A7%89%EA%B8%B0

 

[Android] 다중 창 막기

이번 포스트에선 안드로이드 누가 버전(Android 7.0, API Level 24)부터 새로 생긴 기능인 다중 창(multi windows)을 막는 방법을 소개해드리겠습니다. 이게 왜 필요하냐면 다중 창 모드가 시작되고 해제될

50billion-dollars.tistory.com

 

 

[추가] API 31이상, 큰 화면(sw >= 600dp)에서는 Multi Window가 막히지 않는 것 같다.(경고는 뜸)

resizeableActivity

매니페스트의 <activity> 또는 <application> 요소에서 이 속성을 설정하여 API 수준 30 이하에서 멀티 윈도우 모드를 사용 설정하거나 사용 중지할 수 있습니다.

 
<application
  android:name=".MyActivity"
  android:resizeableActivity=["true" | "false"] />

이 속성을 true로 설정하면, 활동을 화면 분할 모드와 자유 형식 모드로 시작할 수 있습니다. 이 속성을 false로 설정하면, 활동이 멀티 윈도우 모드를 지원하지 않습니다. 이 값이 false일 때 사용자가 멀티 윈도우 모드로 활동을 시작하려고 하면 활동은 전체 화면으로 열립니다.

앱이 API 수준 24 이상을 타겟팅하지만 이 속성 값을 지정하지 않은 경우 이 속성의 기본값은 true가 됩니다.

앱이 API 수준 31 이상을 타겟팅하는 경우 이 속성은 작은 화면 및 큰 화면에서 다르게 작동합니다.

  • 큰 화면(sw >= 600dp): 모든 앱이 멀티 윈도우 모드를 지원합니다. 이 속성은 활동의 크기를 조절할 수 있는지 여부를 나타냅니다. resizeableActivity="false"인 경우 디스플레이 치수를 준수하기 위해 필요한 경우 앱이 호환성 모드로 전환됩니다.
  • 작은 화면(sw < 600dp): resizeableActivity="true" 및 활동 최소 너비 및 최소 높이가 멀티 윈도우 요구사항 내에 있는 경우 활동은 멀티 윈도우 모드를 지원합니다. resizeableActivity="false"인 경우 활동이 최소 너비 및 높이와 관계없이 멀티 윈도우 모드를 지원하지 않습니다.

[참조] https://developer.android.com/guide/topics/large-screens/multi-window-support

 

멀티 윈도우 지원  |  Android 개발자  |  Android Developers

멀티 윈도우 지원 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. 멀티 윈도우 모드를 통해 여러 앱이 같은 화면을 동시에 공유할 수 있습니다. 시스템에서

developer.android.com

 

반응형
Posted by blueasa
, |

[링크] https://scvtwo.tistory.com/190

 

[Unity] 유니티에서 빌드한 apk가 블루스택에서 실행되지 않는 문제 해결

안녕하세요. 유니티에서 빌드해서 apk를 생성 후 블루스택에서 확인하려고 했지만 실행되지 않는 문제가 발생하여, 공유하려고 합니다. Unity 2020.3.19f1에서 발생한 문제였습니다. 휴대폰에 넣었을

scvtwo.tistory.com

 

반응형
Posted by blueasa
, |

[아래 링크의 방법 시도하기 전에 일단 시도해봐야 될 것]

1. 'Player Setting -> Android -> Pubilshing Settings -> Use R8'로 이동

2. 'Use R8'이 체크 안돼 있는지 확인(Non Checked)

3. 'Use R8'이 체크 안돼 있는데도 에러가 난다면, 한 번 체크 했다가 다시 체크 해제

4. 빌드 테스트

 

[에러 수정 후기]

이번에 프로젝트를 Unity2018에서 Unity 2021로 올렸는데 제목과 같은 에러가 났다.

아래 링크의 방법 해보려하다가 Unity2020에서 생성해서 만들어진 gradle을 살펴봤지만 옵션에 문제가 없어보여서 이상하다 싶어서 위에 있는 'Use R8'을 체크 한 번 했다가 다시 체크 해제를 하니 정상적으로 빌드가 된다.

예상으로는 기존에 Unity2018에서 없던 옵션인 'Use R8'이 Unity2021(2020에도 있던데 어디서부터 생긴진 봐야될듯..)에서 새로 추가되면서 기존에는 없던 옵션이 생기면서 원하지 않거나 이상한 값이 저장돼 있는게 아닐까..하고 예상해 봄.

 

[Use R8 옵션 참조]

[Unity 2018] Use R8 옵션이 없다

 

[Unity 2021] Use R8 옵션이 있다.

 

[결론]

Use R8이 꺼져있는데도 위와같은 에러를 낸다면 Use R8 체크했다가, 다시 체크해제 해보자.

안되면 아래 방법으로..

 

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

 

[참조] https://kooksdev.tistory.com/8

 

[Error] Unity WARNING: The option setting 'android.enableR8=false' is deprecated

Gradle 관련 에러 두가지 방법으로 해결할 수 있다 Try 1 Custom Gradle Properties Template를 만들어서 android.enableR8=false를 적기 Try 2 Custom Base Gradle Template를 만들어 Gradle 버전 세팅 나는 두..

kooksdev.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://ajh322.tistory.com/298

 

유니티 빌드 에러 - mainTemplate.gradle file is using the old aaptOptions noCompress property definition which does not in

증상 유니티 버전을 2019대에서 2020대로 올리고 안드로이드 빌드를 하면 mainTemplate.gradle file is using the old aaptOptions noCompress property definition which does not include types defined by unit..

ajh322.tistory.com

 

[링크2] https://codetime.tistory.com/279

 

[Error] mainTemplate.gradle file is using the old aaptOptions 처리

UnityException: Error mainTemplate.gradle file is using the old aaptOptions noCompress property definition which does not include types defined by unityStreamingAssets constant. ※ mainTemplate.grad..

codetime.tistory.com

 

반응형
Posted by blueasa
, |

[링크] https://opchacha.tistory.com/7

 

구글스토어 aab (150Mb이상)파일 업로드방법

구글스토어 150MB 이상 AAB올리는방법 1. google-play-plugins-1.5.0.unitypackage 다운 및 설치https://github.com/google/play-unity-plugins/releases" target="_blank" rel="noopener" data-mce-href=" https:..

opchacha.tistory.com

 

반응형
Posted by blueasa
, |

[증상]

Unity 2019에서 Android API 29를 쓰다가 API 30으로 올려서 Android SDK API 30을 받으려고 하는데 실패하고 아래와 같은 에러메시지가 떴다.

 

Exception: Unable to install additional SDK platform. Please run the SDK Manager manually to make sure you have the latest set of tools and the required platforms installed. 
C:/Program Files/Unity/Hub/Editor/2019.4.22f1/Editor/Data/PlaybackEngines/AndroidPlayer\SDK\tools\bin\sdkmanager.bat "platforms;android-30", exit code 1

그래서 에러메시지에 있는 sdkmanager.bat 파일을 열어보니 JAVA_HOME 환경변수를 쓰고 있다.

요즘 Unity는 OpenJDK를 내장해서 각자 버전별로 쓰고 있기 때문에 환경변수를 만들지 않는데 내부 소스(sdkmanager.bat)에선 여전히 쓰게 해놓은 건 문제인 듯 하다.

 

아무튼 sdkmanager.bat가 돌려면 JAVA_HOME 환경변수를 만들어 줘야되니,

유니티 엔진 내부에 있던 OpenJDK를 C:\ 최상위에 하나 복사하고 JAVA_HOME으로 환경변수 만들어주니 잘 작동한다.

 

[유니티 엔진 내부 OpenJDK 위치] C:\Program Files\Unity\Hub\Editor\2019.4.22f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK

[복사해서 옮긴 위치] C:\OpenJDK

 

[환경변수 셋팅] JAVA_HOME = C:\OpenJDK

 

 

[OpenJDK 시스템 환경변수 설정하기] codedragon.tistory.com/8510

 

OpenJDK - 시스템 환경 변수 설정하기

OpenJDK 설치하기 - openJDK https://codedragon.tistory.com/8774 OpenJDK - 시스템 환경 변수 설정하기 ·      JDK경로 확인하기 ·      JDK경로를 시스템 변수로 등록하기 ·      정상등록..

codedragon.tistory.com

 

 

[참조] forum.unity.com/threads/failed-to-update-android-sdk-package-list-unity-2019-2-10f1.869152/

 

Failed to update Android SDK Package List - Unity 2019.2.10f1

When I try to export the game build for the Android platform, I started getting this error: [ATTACH] Within the Project Settings - Minimum API Level...

forum.unity.com

 

반응형
Posted by blueasa
, |