google play complains: "Invalid Data safety declaration" Data safety (Device or other IDs not declared)
AR foundation forces unity analytics package into project.. maybe its due to that?
see what to fill: https://docs.unity.com/ugs/en-us/manual/analytics/manual/google-data-safety
no need data deletion, or deletion url https://discussions.unity.com/t/link-for-data-deletion-on-google-data-safety-form/934701
Android SDK Build-tools component is not found. Make sure all tools are installed in the SDK manager. Latest supported build-tools version is 30.0.3 UnityEditor.Modules.ModuleManager:InitializePlatformSupportModules ()
???
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156) at com.android.repository.api.SchemaModule.(SchemaModule.java:75) at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
you’re running sdkmanager.bat with too new a Java version and the old Android SDK tools are looking for JAXB (javax.xml.bind.*), which was removed from the JDK in Java 11. (this tool version wants 1.8.x)
need to set correct JAVA_HOME for older version and change PATH variable to java bin folder. and? need to remove common paths from PATH: C:\Program Files\Common Files\Oracle\Java\javapath C:\Program Files (x86)\Common Files\Oracle\Java\java8path C:\Program Files (x86)\Common Files\Oracle\Java\javapath
??? (happened after upgraded sdk for Unity 6000.2 and now try to build in unity 2022.x)
- press upgrade, it opens powershell updater, usually works
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.
Run sdkmanager.bat --update manually once! since it asks for accepting terms
wrong JAVA_HOME ? wrong sdk versions, download new ones from unity releases api list.
Error: LinkageError occurred while loading main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Check that env. variable JAVA_HOME points to correct folder?
Unable to detect SDK in the selected directory. C:/sdk/SDK\cmdline-tools\latest\bin\sdkmanager.bat does not exist. Android SDK command-line tools component is not found. Make sure "Command-line Tools (latest)" is installed in the SDK manager.
If command-line tools are installed, but this message is still shown, please restart the Unity editor.
Download commandline tools, download commandline tools for windows: https://dl.google.com/android/repository/commandlinetools-win-10406996_latest.zip *although i later downloaded older version from https://web.archive.org/web/20230613204636if_/https://dl.google.com/android/repository/commandlinetools-win-9477386_latest.zip (but probably the latest version would had worked also)
incompatible Java version '8'. Android development requires JDK 11 64-bit. Having Java Runtime Environment (JRE) installed is not sufficient.
Set env. variable JAVA_HOME to correct folder, 8 or 11 JDK
you need to manually change download URL from NDK site, not all releases are listed: https://dl.google.com/android/repository/android-ndk-r23c-windows.zip to https://dl.google.com/android/repository/android-ndk-r23b-windows.zip
"error while evaluating property namespace of task unitylibrary:googleplaygamesmanifest.androidlib:packageReleaseResources'
Delete "Assets\Plugins\Android\GooglePlayGamesManifest.androidlib" folder before build (every time)
- On the left menu, Play Games Services/Setup and management/Configuration (but its only available, if you have done play services setup for this app)
- adjust Assets > Dependency Manager > android resolver > Settings
- Disable enable auto-resolution
- Disable Enable resolution on build
- Disable Auto resolution dialog
- solution from here https://stackoverflow.com/a/77648750/5452781
- disable automatic baking from Lighting settings bottom, then press bake manually
- or clear gi cache
how to decode android crash logs / crash stack trace
- You need to use a tool called ‘addr2line’ from the Android NDK https://developer.android.com/ndk/downloads/index.html
- Running the tool is done like so: addr2line -Cfe
- Unity symbol files are found under the Unity installation path: \Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono\Release\Symbols
- Once the tool was launched, you can start inputting memory addresses, and it will output the function name
- https://www.li0rtal.com/decode-unity-crashes-android/
slow build from commandline
- dont use default compression?
app crashes on tablet (works on phone)
- see log, device starts running out of memory, so ActivityManager starts killing other activities https://forum.unity.com/threads/unity-game-works-on-android-phone-but-not-on-android-tablet.1163863/
- What went wrong: Execution failed for task ':launcher:signReleaseBundle'. 1 exception was raised by workers: java.lang.RuntimeException: jarsigner.exefailed with exit code 1 : Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 WARNING: The option setting 'android.bundle.enableUncompressedNativeLibs=false' is experimental and unsupported. The current default is 'true'. Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings Execution failed for task ':launcher:packageRelease'. 1 exception was raised by workers: java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key woodchop from store "****\Keys\user.keystore": Cannot recover key
debug key build works, creating new key works..(password is correct)
missing sdk 30
use commandline to download 30 (unity 2019.4 manages to update it from that dialog) sdk\Android\android-sdk\tools\bin\sdkmanager.bat ..SOMETHINGHERE..
open android native file manager https://forum.unity.com/threads/how-to-open-native-file-manager.1129915/
Get file size of local StreamingAssets file on Android There is no easy way to do that. The only way to get the size of file in StreamingAssets on Android is to read the header of the zip file (apk or obb). https://forum.unity.com/threads/get-file-size-of-local-streamingassets-file-on-android.1123825/#post-7225531
remove app from recent apps: o remove app from recent you just have to add android:autoRemoveFromRecents="true" to AndroidManifest.xml in tag. Then Application.Quit(); will quit the app and it will be removed from recent list. https://forum.unity.com/threads/remove-app-from-recent.325525/#post-7214161
// https://forum.unity.com/threads/remove-app-from-recent.325525/#post-7214161
build and run: "Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]]stdout[Performing Streamed Install]" enable install from ubs in the device (developer settings)
manually install missing sdk version "C:\Program Files 2\2019.4.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat" "platforms;android-28" // https://forum.unity.com/threads/android-sdk-does-not-include-your-target-sdk-of-28.1002894/#post-6508023
wrong NDK 19 version
manually edit version from ndk settings file: https://issuetracker.unity3d.com/issues/unity-hub-android-ndk-integrated-ndk-version-is-not-compatible-with-available-unity-hub-or-android-developer-ndk-versions
PROBLEM WebException: Error: NameResolutionFailure (happens with il2cpp build)
SOLUTION Select [x] internet access required in build settings
PROBLEM build and run: Android device is not responding adb devices shows it unauthorized
SOLUTION unpluck and pluck again, click allow debugging
PROBLEM Failed to extract Android SDK Platform version from string 'Q', Input string was not in a correct format. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
SOLUTION Build still works, probably too new phone model?
PROBLEM CommandInvokationFailure: Failed to update Android SDK package list. x:/sdk/Android/android-sdk\tools\bin\sdkmanager.bat --list
SOLUTION if have tools.backup folder: rename tools/ to tools.broken/ rename tools.backup/ to tools/
PROBLEM forgot keystore password
SOLUTION use bruteforce tool (link) or try guess within editor:
- first browse keystore file
- then enter password there, then try to select key below, if wrong pwd cannot select (faster to test than building)
PROBLEM Cannot download old sdk gui tool, without complete android studio
SOLUTION old archive version, run sdk manager updates after unzipping https://www.dropbox.com/s/aqze528vj59ka7i/android-sdk-with-sdk-manager.7z?dl=0
ERROR OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_ENUM: enum argument out of range (Filename: /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 335)
SOLUTION Dont play video too early, Prepare first. But still gives error after playing when isPrepared == true
ERROR [EGL] Unable to acquire context: EGL_BAD_ALLOC: EGL failed to allocate resources for the requested operation. 11-26 20:35:04.060 12329 12350 E Unity : 11-26 20:35:04.060 12329 12350 E Unity : (Filename: /Users/builduser/buildslave/unity/build/Runtime/GfxDevice/egl/WindowContextEGL.cpp Line: 267)
SOLUTION Disable [ ] multithreaded rendering
I've learned that you can symbolicate the libil2cpp.so frames using the ndk-stack utility: https://developer.android.com/ndk/guides/ndk-stack The debug symbols are in a .zip file next to the generated .apk. You should be able to extract that file, then use ndk-stack to determine the missing frames in that call stack. https://forum.unity.com/threads/sigabrt-crash-soon-after-app-launch.531665/#post-3498831
ERROR UMP player crashes if vr mode is enabled I/DEBUG ( 370): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 370): Build fingerprint: 'samsung/ks01ltexx/ks01lte:5.0.1/LRX22C/I9506XXUDOK1:user/release-keys' I/DEBUG ( 370): Revision: '15' I/DEBUG ( 370): ABI: 'arm' I/DEBUG ( 370): pid: 12465, tid: 12556, name: Thread-36020 >>> com.edu2vr.localstreamplayer <<< I/DEBUG ( 370): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x382c206e I/DEBUG ( 370): r0 382c200a r1 00100007 r2 9dedda50 r3 00000000 I/DEBUG ( 370): r4 9dedda50 r5 9e001780 r6 9e001780 r7 00000078 I/DEBUG ( 370): r8 004f8a74 r9 ad24d2d0 sl 9e5f8ab4 fp ad256e40 I/DEBUG ( 370): ip 9a0fa900 sp 9e001768 lr 9a08df6d pc 99fc0af8 cpsr 60070030 I/DEBUG ( 370): I/DEBUG ( 370): backtrace: I/DEBUG ( 370): #00 pc 0001daf8 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #01 pc 000eaf69 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #02 pc 000b73e7 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #03 pc 00033047 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #04 pc 000330ab /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #05 pc 0002c3eb /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libgvr.so I/DEBUG ( 370): #06 pc 009f6d7c /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #07 pc 009eaf40 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #08 pc 00565c7c /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #09 pc 00566a9c /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #10 pc 00560904 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #11 pc 003cfa10 /data/app/com.edu2vr.localstreamplayer-2/lib/arm/libunity.so I/DEBUG ( 370): #12 pc 000137b3 /system/lib/libc.so (__pthread_start(void*)+30) I/DEBUG ( 370): #13 pc 00011893 /system/lib/libc.so (__start_thread+6) I/DEBUG ( 370): I/DEBUG ( 370): Tombstone written to: /data/tombstones/tombstone_04
SOLUTION Disable multithreaded rendering
ERROR I/Unity ( 1556): Could not recreate VR window because GfxDevice is in an invalid state (device lost) I/Unity ( 1556): I/Unity ( 1556): (Filename: Line: 850)
SOLUTION ???????
ERROR cardboard app shows black screen
E/Unity (29419): OPENGL NATIVE PLUG-IN ERROR: GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is not complete or incompatible with command E/Unity (29419): E/Unity (29419): (Filename: ./Runtime/GfxDevice/opengles/GfxDeviceGLES.cpp Line: 388)
SOLUTION ????? Enable multithreading?
ERROR cardboard app crashes or shows black/white screen logcat: W/ActivityManager( 1029): Unable to start service Intent { act=com.google.vr.vrcore.controller.BIND pkg=com.google.vr.vrcore } U=0: not found
SOLUTION ???
ERROR Installation failed with the following output: [ 0%] /data/local/tmp/player.apk [ 0%] /data/local/tmp/player.apk [ 0%] /data/local/tmp/player.apk [ 0%] /data/local/tmp/player.apk
SOLUTION Set lower API level in build settings
ERROR CommandInvokationFailure: Failed to build apk. Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
SOLUTION Dont use JAVA9, use 8 http://answers.unity3d.com/questions/1415655/android-apk-build-failed-error-how-do-i-fix-this.html
ERROR CommandInvokationFailure: Failed to re-package resources. ***\android-sdk\build-tools\25.0.2\aapt.exe package --auto-add-overlay -v -f -m -J "gen" -M "AndroidManifest.xml" -S "res" -I "***android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ --extra-packages com.google.vr.cardboard:com.unity3d.unitygvr -S "***Game\Temp\StagingArea\android-libraries\gvr\res" -S "***Game\Temp\StagingArea\android-libraries\unitygvr\res"
stderr[ AndroidManifest.xml:5: error: Error: String types not allowed (at 'configChanges' with value 'mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density'). ]
SOLUTION Tried updating JDK1.7.9 or older 1.8.0, uninstalled them, installed version JDK8 (JDK9 doesnt work), restart unity. http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html but didnt help, then solution was run SDK Manager, install API 26 SDK Platform tools, i had API 23 installed..
PROBLEM build size
SOLUTION remove vulcan from graphics apis: (saves space) https://forum.unity.com/threads/google-play-shows-app-only-on-3000-over-13k-devices-on-which-the-game-should-run-just-fine.775841/#post-5170550
PROBLEM "Shader error in 'Hidden/PostProcessing/FinalPass': Input signature parameter (1-based Entry 3) type must be a scalar uint. at line 44 (on gles)"
SOLUTION remove opengls2.0 from automatic graphics API list
PROBLEM FormatException: Input string was not in a correct format. at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal)
SOLUTION Need to unplug android and plug back, if you had upgraded android while it was connected
PROBLEM Unity Keystore Not Accepting Correct Password
SOLUTION (maybe) https://forum.unity.com/threads/unity-keystore-not-accepting-correct-password.629329/#post-9528544
"Gradle failed to fetch dependencies"
https://forum.unity.com/threads/awful-android-build-experience.1168022/#post-7484519