세상사는 이야기 / 도움이 되었다면 배너 클릭 부탁드려요~ →→→

2021년 8월 23일 월요일

[Unity Android] Build - error: unexpected element found in

유니티에서 Plugin 추가 후 빌드 에러가 발생했다.

    유니티 버전 2019.4.29f1


증상

* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> Android resource linking failed
C:\Work\DCubeClient\Temp\gradleOut\launcher\build\intermediates\merged_manifests\release\AndroidManifest.xml:42: AAPT: error: unexpected element <queries> found in <manifest>.



빌드된 merged_manifests 파일 확인

C:\Work\DCubeClient\Temp\gradleOut\launcher\build\intermediates\merged_manifests\release\AndroidManifest.xml


해결법

Gradle 버전이 낮아서 생기는 문제로 3.4.0 -> 3.4.3 변경한다.

    참고

    https://stackoverflow.com/questions/62969917/how-to-fix-unexpected-element-queries-found-in-manifest-error


1. BaseGradleTemplate 체크


2. Assets\Plugins\Android\baseProjectTemplate.gradle File 편집

gradle:3.4.0 -> gradle:3.4.3 으로 변경 후 저장

classpath 'com.android.tools.build:gradle:3.4.0' -> classpath 'com.android.tools.build:gradle:3.4.3' ->



baseProjectTemplate.gradle File

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
allprojects {
    buildscript {
        repositories {**ARTIFACTORYREPOSITORY**
            google()
            jcenter()
        }

        dependencies {
            // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
            // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
            // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
            // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
            classpath 'com.android.tools.build:gradle:3.4.3'
            **BUILD_SCRIPT_DEPS**
        }
    }

    repositories {**ARTIFACTORYREPOSITORY**
        google()
        jcenter()
        flatDir {
            dirs "${project(':unityLibrary').projectDir}/libs"
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


2021년 8월 13일 금요일

[GoogleAPI] Drive Error : dailyLimitExceededUnreg - 일일 한도 초과 등록 해제

GoogleAPI Drive Error

잘되던 게임이 갑자기 안되어 로그를 확인하니 아래 링크로 보내고 있었다.


2021-08-13 14:41:08.095 6049-6094/com.google.android.gms E/Volley: [269] NetworkUtility.b: Unexpected response code 404 for https://www.googleapis.com/drive/v2internal/files/1JDF7mwSVgpmFLVQgapIgHO0oQPyapndbOO49s8eqbJcJq1mRkxglacJPtjg-JN2k6Bw4HQg?prettyPrint=false&fields=owners(isAuthenticatedUser,picture(url),displayName,permissionId,emailAddress),spaces,webContentLink,lastModifyingUser(isAuthenticatedUser,picture(url),displayName,permissionId,emailAddress),originalFilename,headRevisionId,fileExtension,id,recencyReason,folderColorRgb,version,webViewLink,indexableText(text),editable,gplusMedia,quotaBytesUsed,properties(key,value,appId,visibility),writersCanShare,sharedWithMeDate,explicitlyTrashed,shared,authorizedAppIds,parents(isRoot,id),thumbnailLink,creatorAppId,modifiedByMeDate,labels(restricted,trashed,starred,viewed),appDataContents,md5Checksum,localId(value,space,version),thumbnail(mimeType,image),ownerNames,sharingUser(isAuthenticatedUser,picture(url),displayName,permissionId,emailAddress),copyable,modifiedDate,userPermission(id,role,withLink,domain,name,additionalRoles,value,type,emailAddress,photoLink),etag,recency,createdDate,alternateLink,mimeType,lastViewedByMeDate,folderFeatures,description,title,fileSize,downloadUrl,embedLink,subscribed&acknowledgeAbuse=false&allProperties=true&fileScopeAppIds=848143016023&updateViewedDate=false


링크의 에러

{"error":{"errors":[{"domain":"usageLimits","reason":"dailyLimitExceededUnreg","message":"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.","extendedHelp":"https://code.google.com/apis/console"}],"code":403,"message":"Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."}}

API 할당량을 늘려주면 해결된다.
Google Cloud Platform -> 할당량 -> 할당량 수정 -> 전체


2021년 3월 16일 화요일

[Unity Android] Unity 2019.x multi Dex 64k 해결법


Unity 2019.x multi Dex 64k 해결법

Unity 2019 버전으로 넘어오면서 기능이 바뀌여 다른 방식으로 해야 한다.


해결 방법

"Edit" -> "Player Settings" -> "Player"탭 -> "Publishing Settings" -> "Custom Launcher Gradle Template" 체크 후 생성된 파일을 수정한다.

  • Assets\Plugins\Android\launcherTemplate.gradle



Assets\Plugins\Android\launcherTemplate.gradle 파일에 아래 줄 추가
defaultConfig {
    multiDexEnabled true // 추가

}


// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN

apply plugin: 'com.android.application'

dependencies {
    implementation project(':unityLibrary')
}

android {
    compileSdkVersion **APIVERSION**
    buildToolsVersion '**BUILDTOOLS**'

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }

    defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        multiDexEnabled true
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
    }

    aaptOptions {
        noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**]
        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
    }**SIGN**

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            minifyEnabled **MINIFY_DEBUG**
            useProguard **PROGUARD_DEBUG**
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
            jniDebuggable true
        }
        release {
            minifyEnabled **MINIFY_RELEASE**
            useProguard **PROGUARD_RELEASE**
            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
        }
    }**PACKAGING_OPTIONS****SPLITS**
    **BUILT_APK_LOCATION**
    bundle {
        language {
            enableSplit = false
        }
        density {
            enableSplit = false
        }
        abi {
            enableSplit = true
        }
    }
}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**

2021년 3월 10일 수요일

[Unity] Custom Packages 만들기

Custom Packages 만들기

https://docs.unity3d.com/kr/current/Manual/CustomPackages.html


회사에 팀끼리의 Lib를 공유할일이 생겨 Custom Package를 사용하려고 한다.

아래 Package 생성과정을 정리한다.


내장된 패키지 새로 만들기 - 직접 프로젝트에 만들어서 사용할때


생성 Project/Packages 폴더에 새로운 폴더를 생성

생성 폴더아래 package.json 파일을 만든다.



패키지 매니페스트 편집(package.json 파일)

설명은 유니티 docs 참고

https://docs.unity3d.com/kr/current/Manual/upm-manifestPkg.html

{
  "name": "com.graivity.lab",
  "version": "0.0.1",
  "displayName": "Graivity SDK",
  "description": "Graivity Common SDK Package",
  "unity": "2018.4",
  "unityRelease": "0b4",
  "dependencies": {
  },
  "keywords": [
    "Graivity",
    "Common"
  ],
  "author": {
    "name": "Deukhyun Han",
    "email": "gravity@gravityneocyon.com",
    "url": "https://www.gravityneocyon.com"
  }
}


유니티를 재 시작하고  Package Manager를 열면 내가 만든 Package가 생성되어 있다.



새로운 로컬 패키지 만들기 - Package 파일로 공유할때

생성 Project/Assets 폴더아래 package.json 파일을 만든다.

패키지 매니페스트 편집(package.json 파일)

위 참고


다른 프로젝트에서 Custom Package 로드
Window/Package Manager/Add package from disk


Package.jon 선택


확인




2021년 2월 8일 월요일

[Unity] Package Manager - Use Google API

 Unity Google API를 사용하는 방법은 2가지가 있다.


 1. Package를 다운받아서 설치하는 방법

 2. Unity Package Manager에서 추가하는 방법


https://docs.unity3d.com/2019.4/Documentation/Manual/upm-scoped.html

2번을 설명하겠다.


2020.05.19 종료

2021년 1월 22일 금요일

[Unity] Error while downloading Asset Bundle: CRC Mismatch

에셋번들 패치 후 아래 에러가 발생했다.

2021-01-20 09:27:04.507 13273-19108/? E/Unity: Error while downloading Asset Bundle: CRC Mismatch. Provided 55c7e683, calculated 3ce95af1 from data. Will not load AssetBundle 'http://192.0.0.1/Android/Android_1/font.unity3d'

나의 경우 유니티 버전을 올려서 에러가 발생했다.

유니티버전을 올리고 빌드를 진행하면 파일 앞부분의 버전도 올라가게 된다.

이전 유니티 버전으로 다시 에셋번들을 만들어서 패치해도 에러가 발생..

캐쉬를 지워주는 기능을 만들어야할듯하다.

이전 버전으로 돌리고 에셋번들을 빌드하면 바뀐 파일들이 보인데.

해당파일을 패치파일로 업로드한다.


그래도 변경되지 않는다면 해당 에셋데이터를 건들고(Active or 좌표 1.0001변경등) 다시 에셋번들을 뽑는다.


이전 에셋번들데이터를 "font.unity3d" 데이터 확인

UnityFS 5.x.x 2018.4.21f1 ` A [ C  ? D€ ? A   ? CAB-a6422a952d839.....

패치된 에셋번들데이터를 "font.unity3d" 데이터 확인

UnityFS 5.x.x 2018.4.29f1 ` A [ C  ? D€ ? A   ? CAB-a6422a952d839......


유니티 포럼에서는 항상 같은 버전의 유니티에서 에셋번들을 만들라고 하고 있다.




2021년 1월 11일 월요일

[UnityIAP] UnityIAP 2.2.5 Consume처리시 empty transactionID Error 발생

UnityIAP 2.2.5 설치 후  Consume 되지 않은 상품 Consume 처리시 empty transactionID Error 발생

Unable to confirm purchase; Product has missing or empty transactionID


또 유니티IAP 팀이 다음 버전을 기다리라고 함..

2.2.2 버전 이후부터 계속 버그가 생기네...

https://forum.unity.com/threads/bug-unity-iap-2-2-5-cannot-confirmpendingpurchase.1023700/#post-6700876


Packages Manager의 버전과 Unity AssetStore의 버전은 다르다.

2020년 11월 12일 목요일

[UnityIAP] UnityIAP 2.2.0 업데이트 후 Error 발생

UnityIAP 2.2.0 업데이트 후 Error 발생

2020년 11월 17일 UnityIAP 2.2.1 업데이트


2020년 11월 10일 UnityIAP 2.2.0로 업데이트 되었다.

빌드 후 구매 확인하면 아래와 같은 에러가 발생한다.


에러 내용

2020-11-12 11:08:37.891 3182-3182/com.neocyon.google.ro2odin E/Unity: ArgumentNullException: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00000] in <00000000000000000000000000000000>:0
at System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Purchasing.ProductCollection.WithStoreSpecificID (System.String id) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Purchasing.PurchasingManager.OnPurchaseFailed (UnityEngine.Purchasing.Extension.PurchaseFailureDescription description) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Purchasing.GooglePlayPurchaseCallback.OnPurchaseFailed (UnityEngine.Purchasing.Extension.PurchaseFailureDescription purchaseFailureDescription) [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.Purchasing.GooglePurchaseUpdatedListener.HandleErrorCases (UnityEngine.Purchasing.Models.GoogleBillingResult billingResult, Unit


아직 Unity IAP 팀에서 원인과 해결 방법을 찾고 있는것 같다.

https://forum.unity.com/forums/unity-iap.112/


이전 버전으로 깔고 싶지만 구글 검색해도 나오지 않는다. 

2.2.0을 삭제 후 아래 링크에서 이전 버전 2.1.1 Package를 다운로드 받으면 된다.

UnityEngine.Cloud.Purchasing-2.1.1-83eca73c.unitypackage


https://forum.unity.com/threads/unity-iap-previous-versions.527432/#post-6506544



2020년 11월 6일 금요일

[Unity IAP] UnityIAP Import중 에러 발생 "The IAP service is currently disabled"

Unity Serviece에서 Store Package를 Import중 에러가 발생했다.

error: "The IAP service is currently disabled"

The IAP service is currently disabled.

Canceling the install process now to avoid encountering errors when importing the Unity IAP asset package. The IAP service must be enabled first before importing the latest Unity IAP asset package.
Please enable the IAP service through the Services window. Then import the Unity IAP asset package again to continue the install.

Select 'Help...' to see further instructions.

UnityIAP Docs에는 아래와 같은 설명이 있다.

참고: 흔한 Unity IAP 통합 컴파일러 오류
아래 오류 메시지는 Unity Cloud 서비스 창에서 Unity IAP가 비활성화되었거나, Unity가 인터넷에 연결되어 있지 않다는 점을 나타냅니다.

CS0246: IPurchaseReceipt 유형 또는 네임스페이스 찾을 수 없음.
System.Reflection.ReflectionTypeLoadException
UnityPurchasing/Bin/Stores.dll
UnityEngine.Purchasing

이 오류를 해결하려면 우선 서비스 창을 새로고침 해야 합니다. 간단하게 닫고 다시 열면 됩니다. 새로고침 후 Unity IAP가 활성화되었는지 확인해야 합니다.
해결되지 않은 경우, 인터넷 연결을 해제하고 재연결 한 후, Unity 서비스에 다시 로그인한 다음 Unity IAP를 활성화해야 합니다. 등록 기관의 Unity 서비스 “소유자” 또는 “관리자” 만이 Unity IAP 서비스를 활성화할 수 있습니다.


이유는 Unity Package Manager내부에서 define이 꼬인것 같다.

재설치나 협업중에는 Import순서가 중요하겠다.

- Package Manager/In App Purchasing Install -> Unity Service IAP Import


1. Unity/Window/Package Manager/In App Purchasing Install


2. Unity Service/IN-APP PURCHASING - Import(Reimport) -> Import Package

3. Import 확인

Plugins, Packages폴더



그래도 안될 경우

직접 Unity Servieces 파일을 수정 한다.

ProjectSettings/UnityConnectSettings.asset

  UnityPurchasingSettings:

    m_Enabled: 1


 m_Enabled: 0 으로 되어있으면 1로 수정

2020년 9월 2일 수요일

[IOS] Xcode 빌드 업로드에러 no accounts with app store connect access have been found for the team

ios Xcode 빌드 후 업로드를 하려는데 오류가 발생했다.

no accounts with app store connect access have been found for the team "xxxxxx" App Store Connect access is required for Developer ID distribution.



검색해 보니 xcode를 프로세서에서 완전 제거후에 다시 xcode를 실행 후 빌드하면
해당 증상이 없어졌다고 하는데

나는 그냥 맥 재부팅 후 빌드 하지 않고 "Organizer"에 빌드된 "Archive"를 다시 "Distribute App"으로 업로드 하니 잘되었다.