Unable to determine which android packages are installed unity

App Bundle package errors if Unity Android not installed #11

Comments

jsteinich commented Apr 30, 2020

Our game supports both Android and iOS. We build the two platforms using separate servers with each having their respective unity platform components.
I’m in the process of switching the Android side from just Unity IAP to Unity IAP + Google Play Billing. In doing so, the Android app bundle package is installed as a dependency.
Now when building for iOS, the app bundle package fails to compile with the following errors:

Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/JavaUtils.cs(107,32): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(41,27): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(85,23): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(86,24): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(88,23): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
Library/PackageCache/com.google.android.appbundle@1.0.0/Editor/Scripts/Internal/BuildTools/AndroidSdk.cs(89,24): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)

I’m not aware of anyway to make package references only apply with certain targets and adding the Android components would cause build slowdowns.

I could put together a quick PR adding some #if UNITY_ANDROID blocks, but perhaps there is a better way.

The text was updated successfully, but these errors were encountered:

jamcohen commented Apr 30, 2020

Thanks for bringing this up. There should be no need for #if blocks, since we have .asmdef files that should prevent packages from being included in iOS builds.

Which Unity version are you using?
In your com.google.android.appbundle folder, do you see a Google.Android.AppBundle.Editor.asmdef file? If you select it in Unity you should see this in your inspector:

Thanks again, hopefully we can get this resolved for you.

jamcohen commented Apr 30, 2020

I tested on 2019.3.5f1 and couldn’t reproduce the issue.
Does the issue occur when building locally (i.e. not on your build server)?
Also, just to clarify, you do not run into this when you build for Android, correct?

Читайте также:  Sound lock для андроид 4pda

jsteinich commented Apr 30, 2020

I don’t actually have that folder since I am referencing it as a package (technically it is in Library/PackageCache).
I just have «com.google.play.billing»: «2.2.0» in my Packages/manifest.json file as a result of following https://developer.android.com/google/play/billing/unity

I’m on Unity 2019.3.0f6. I don’t have the issue locally, but I also have the Unity Android component installed. An Android build is successful.

The asmdef file is just saying to only include in editor, which is correct; however, I believe some Android (and iOS) editor components only exist if the associated Unity component is installed.
I ran into something similar a couple weeks ago when referencing something from UnityEditor.Android namespace.

jamcohen commented Apr 30, 2020

Ah I see, I’ll try installing 2019.3.0f6 without the Android component and see if I run into the same issue.

jamcohen commented May 1, 2020

I was able to reproduce the issue and submitted a fix to our internal repo.
Once that’s reviewed and finalized we’ll push the fix to Github.
Thanks again for bringing this to our attention!

jamcohen commented May 1, 2020

Just pushed the fix to github.
Once we cut a new release it will be available from the Unity package manager.

jamcohen commented May 11, 2020

Release v1.1.0 includes this fix. Feel free to reopen if the issue persists.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Failed to determine the most recently installed Android SDK version #320

Comments

unace commented Feb 3, 2020 •

Please fill in the following fields:
Unity editor version: 2019.3.0f6
Play Services Resolver version:
1.2.133
Features in Play Services Resolver in use (Android Resolver, iOS Resolver, VersionHandler, etc.):
I don’t know exactly. maybe Android Resolver?
Plugins SDK in use (Firebase, Admob, Facebook, etc.):
Firebase 6.9.0
Platform you are using the Unity editor on (Mac, Windows, or Linux):
Mac
Platform you are targeting (iOS, Android, and/or desktop):
Android
Scripting Runtime (Mono, and/or IL2CPP):
IL2CPP

Please describe the issue here:
(Please list the full steps to reproduce the issue. Include device logs, Unity logs, and stack traces if available.)

Hi,
I got this error whenever running Unity.

I haven’t installed Oracle JDK manually, but I installed Unity with Open JDK (path : /Applications/Unity/Hub/Editor/2019.3.0f6/PlaybackEngines/AndroidPlayer/OpenJDK).
Do I have to install Oracle JDK?

Please let me know if you need more information.

Please answer the following, if applicable:
100%

  1. prepare Mac that doesn’t have /usr/bin/java.
  2. install Unity 2019.3.0f6
  3. download Firebase Unity SDK 6.9.0
  4. create a Unity 3D project
  5. import Firebase package
  6. switch target platform to Android
  7. reopen the project

The text was updated successfully, but these errors were encountered:

google-oss-bot commented Feb 3, 2020

This issue does not seem to follow the issue template. Make sure you provide all the required information.

paulinon commented Feb 4, 2020

Thanks for reporting this issue, @unace. I’ll see if I can try to reproduce this issue on my end. In the meantime, could you try making use of the updated versions of your Play Services Resolver and Firebase SDK to see if the issue still persists?

unace commented Feb 6, 2020 •

hi @paulinon , I am still facing the same issue with the updated version (Play Services Resolver version:
1.2.135, Firebase version: 6.10.0). I forgot to mention the «switching to Android platform» step, just added it to repro steps.

paulinon commented Feb 11, 2020

Hi @unace, your issue may have something to do with a newer Java release returning a different status code or version string. Could you try running java -version; echo $? and share the results so we can see what’s going on?

Читайте также:  Мобильный сканер одежды android

unace commented Feb 12, 2020 •

It returns «No Java runtime present, requesting install.» as shown in the Unity error log that I shared.
That’s why I asked «I haven’t installed Oracle JDK manually, but I installed Unity with Open JDK (path : /Applications/Unity/Hub/Editor/2019.3.0f6/PlaybackEngines/AndroidPlayer/OpenJDK).
Do I have to install Oracle JDK?»

paulinon commented Feb 13, 2020

It appears that the configuration of the Java tools location is broken. Try installing Oracle JDK and see if it works.

unace commented Feb 13, 2020 •

It sounds Oracle JDK is required to use unity jar resolver. If so, could you add it to requirements documentation (https://github.com/googlesamples/unity-jar-resolver#requirements)? It would be helpful.

And one more question, Is there any reason to use Oracle JDK instead of Open JDK?

TheOneVries commented Feb 16, 2020 •

Came here due to the same error, using Unity 2019.3.1f1.
I do have Oracle JDK installed though (jdk-13.0.2)
Installing the JDK resolved some other issues I had, but this warning shows up every time I open the project.

Failed to determine the most recently installed Android SDK version. Please report this as a bug with the version of Unity you are using at: https://github.com/googlesamples/unity-jar-resolver/issues Resorting to reading a fallback value from the editor preferences GooglePlayServices.PlatformVersionFallback: 25 UnityEngine.Debug:LogWarning(Object) GooglePlayServices.UnityCompat:WarnOnAndroidSdkFallbackVersion() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/UnityCompat.cs:239) GooglePlayServices.UnityCompat:FindNewestInstalledAndroidSDKVersion() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/UnityCompat.cs:314) GooglePlayServices.UnityCompat:GetAndroidTargetSDKVersion() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/UnityCompat.cs:121) GooglePlayServices.PlayServicesResolver:CanEnableJetifierOrPromptUser(String) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:2314) GooglePlayServices.PlayServicesResolver:ResolveUnsafe(Action 1, Boolean, Boolean, Boolean) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1635)
GooglePlayServices.c__AnonStorey1E:<>m__3F() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1604)
GooglePlayServices.PlayServicesResolver:ExecuteNextResolveJob() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1461)
GooglePlayServices.PlayServicesResolver:ScheduleResolve(Boolean, Boolean, Action 1, Boolean) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1617) GooglePlayServices.PlayServicesResolver:AutoResolve(Action) (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1134) GooglePlayServices.PlayServicesResolver: m__47() (at /Users/smiles/dev/src/unity-jar-resolver/source/PlayServicesResolver/src/PlayServicesResolver.cs:1113) Google.RunOnMainThread:ExecutePollingJobs() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:300) Google.RunOnMainThread: m__A() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:414) Google.RunOnMainThread:RunAction(Action) (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:234) Google.RunOnMainThread:ExecuteAll() (at /Users/smiles/dev/src/unity-jar-resolver/source/VersionHandlerImpl/src/RunOnMainThread.cs:406) UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

unace commented Feb 17, 2020

I think I found the reason. The OpenJDK path seems to be changed from certain Unity version (2019.3.0 and 2019.3.1 verified on mac). I made a pull request to fix this. #325

sp-jordi-vilalta commented Feb 21, 2020

This may be related to #323 and I think it may also be solved by using AndroidExternalToolsSettings when available.

unace commented Feb 21, 2020

@sp-jordi-vilalta thanks for the information. The AndroidExternalToolsSettings API seems to be added to 2019.3.0. but it doesn’t work with 2019.3.2f1 on my mac.

this code leads an error.
Assets/Test.cs(10,19): error CS0234: The type or namespace name ‘AndroidExternalToolsSettings’ does not exist in the namespace ‘UnityEditor.Android’ (are you missing an assembly reference?)
This looks like a Unity error so I reported it to Unity.

paulinon commented Feb 25, 2020

Hi everyone. Version 1.2.136 has been released which fixed OpenJDK path discovery in Unity 2019.3.1. Could you try using these versions on your end and see if the issue has been resolved? Thanks.

unace commented Mar 4, 2020

I made a new MR(#329) to fix this. Thanks @sp-jordi-vilalta

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

2020.2 2f1 not building for Android #944

Comments

SummerLynx commented Jan 30, 2021 •

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.2 1f1, 2020.2 2f1
  • Firebase Unity SDK version: 7.0.2_
  • Source you installed the SDK: .unitypackage
  • Problematic Firebase Component: Analytics
  • Other Firebase Components in use: Auth, Firestore, Storage
  • Additional SDKs you are using: None
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP
Читайте также:  Snap page android это

[REQUIRED] Please describe the issue here:

Can not build for Android. When you install Firebase, your JDK link breaks. You are getting a JAVA_HOME error on build). If you try to fix that with:
untoggle everying Android SDK, JDK and NDK related it in preferences, restart Unity, toggle It back
you get a message: do you want to activate Jetpack? AndroidX Jetttison needs target api to be 28 and forces the «Target Api level»
to 28, which is not installed by default by Unity Hub, because they use 29. so you can’t build with that. If you switch target back to (highest), it almost builds, but on «Building Gradle project» you get an error, described in issue #377.

If you try to reimport firebase sdk, you get the cycle of «JDK» link breaking.
I managed to make it build once somehow, but the app crached on firebase app initialization

Note: C:\Work\MatterFlowCommunity\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:launcher:mergeReleaseNativeLibs’.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
More than one file was found with OS independent path ‘lib/armeabi-v7a/libFirebaseCppAnalytics.so’

Try:
Run with —stacktrace option to get the stack trace. Run with —info or —debug option to get more log output. Run with —scan to get full insights.

BUILD FAILED in 25s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use —status for details

Configure project :launcher
WARNING: The option ‘android.enableR8’ is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2020.2.1f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only

Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:preBuild UP-TO-DATE
Task :launcher:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:preReleaseBuild UP-TO-DATE
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseAidl NO-SOURCE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResValues
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseResources
Task :unityLibrary:generateReleaseBuildConfig
Task :launcher:generateReleaseBuildConfig
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:generateReleaseResValues
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResources
Task :launcher:mainApkListPersistenceRelease
Task :launcher:generateReleaseResValues
Task :launcher:generateReleaseResources
Task :launcher:createReleaseCompatibleScreenManifests
Task :launcher:extractDeepLinksRelease
Task :launcher:prepareLintJar
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseResources
Task :unityLibrary:packageReleaseResources
Task :unityLibrary:extractDeepLinksRelease
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseBuildConfig
Task :unityLibrary:FirebaseApp.androidlib:extractDeepLinksRelease
Task :unityLibrary:compileReleaseLibraryResources
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseLibraryResources
Task :unityLibrary:prepareLintJarForPublish
Task :unityLibrary:FirebaseApp.androidlib:javaPreCompileRelease
Task :unityLibrary:FirebaseApp.androidlib:prepareLintJarForPublish
Task :unityLibrary:parseReleaseLocalResources
Task :unityLibrary:FirebaseApp.androidlib:parseReleaseLocalResources
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseShaders
Task :unityLibrary:mergeReleaseShaders
Task :unityLibrary:compileReleaseShaders
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseShaders
Task :unityLibrary:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:packageReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:processReleaseManifest
Task :launcher:checkReleaseDuplicateClasses
Task :unityLibrary:FirebaseApp.androidlib:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:bundleLibResRelease
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseJniLibFolders
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:FirebaseApp.androidlib:generateReleaseRFile
Task :unityLibrary:mergeReleaseJniLibFolders
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:bundleLibResRelease
Task :unityLibrary:mergeReleaseNativeLibs

Task :launcher:processReleaseManifest
C:\Work\MatterFlowCommunity\Temp\gradleOut\launcher\src\main\AndroidManifest.xml:27:9-34:50 Warning:
activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:27 to replace other declarations but no other declaration present

Task :unityLibrary:stripReleaseDebugSymbols
Task :launcher:mergeReleaseShaders
Task :launcher:compileReleaseShaders
Task :launcher:generateReleaseAssets
Task :unityLibrary:FirebaseApp.androidlib:compileReleaseJavaWithJavac
Task :unityLibrary:FirebaseApp.androidlib:bundleLibCompileRelease
Task :unityLibrary:FirebaseApp.androidlib:mergeReleaseNativeLibs
Task :unityLibrary:FirebaseApp.androidlib:stripReleaseDebugSymbols
Task :unityLibrary:FirebaseApp.androidlib:copyReleaseJniLibsProjectOnly
Task :unityLibrary:FirebaseApp.androidlib:bundleLibRuntimeRelease
Task :launcher:mergeReleaseAssets
Task :launcher:processReleaseJavaRes NO-SOURCE
Task :launcher:mergeReleaseJniLibFolders
Task :launcher:validateSigningRelease
Task :unityLibrary:copyReleaseJniLibsProjectOnly
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:generateReleaseRFile
Task :launcher:mergeReleaseResources

Task :launcher:processReleaseResources
Task :unityLibrary:bundleLibCompileRelease
Task :unityLibrary:bundleLibRuntimeRelease
Task :launcher:mergeReleaseJavaResource
Task :launcher:desugarReleaseFileDependencies
Task :launcher:javaPreCompileRelease
Task :launcher:compileReleaseJavaWithJavac
Task :launcher:compileReleaseSources
Task :launcher:dexBuilderRelease
Task :launcher:mergeReleaseNativeLibs FAILED
Task :launcher:lintVitalRelease
Task :launcher:mergeExtDexRelease
65 actionable tasks: 65 executed

Источник

Оцените статью