Skip to content

build problems #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tantzygames opened this issue Nov 13, 2017 · 5 comments
Closed

build problems #8

tantzygames opened this issue Nov 13, 2017 · 5 comments

Comments

@tantzygames
Copy link

tantzygames commented Nov 13, 2017

I really appreciate you sharing this project. This is just a request to please include the pre-built asset bundles instead of requiring the files be built.

I am one of those Unity Developers that clivehenrik mentioned in another issue. With all the dependencies and problems it's taken me many frustrating hours just to build the files. Problems have included:
sdk and ndk not found (I had to make a local.properties file including the location of the Android sdk and ndk)
I needed to install specific Android sdk and sdk tools versions
CMake license not found (took a few hours to solve: The GNU license txt file needs to be included in the sdk/licenses folder)
Java tools.jar not found (had to copy from a different Java installation)
Then I had to specify a newer ndk installation in the local.properties (was r10e, needs 12+)
Then it failed to find unity.exe (I had to change the install location in build.gradle to an existing location)
Then Execution failed for task ':inject_versionIntoMetaFiles' for google-signin-plugin_v1.0.0.txt.meta (Access was denied)
Then it couldn't copy google-signin-plugin_v1.0.0.txt.meta file from the src path to the project path (I first thought because my directory name was different to the one hard coded into build.gradle, but that didn't fix it)

At this point I was hoping the project had been built correctly, that it just hadn't been packaged into asset bundles, so I have given up on fixing build errors and copied the files from the build folder to my project.

@tantzygames
Copy link
Author

tantzygames commented Nov 13, 2017

When first building there was an AndroidManifest merge problem. The AndroidManifest in the google-signin-support-1.0.1 folder includes:
uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="26"

The other firebase libraries only include the minSdkVersion as 14 without a potentially conflicting targetSdkVersion. Does this plugin require the targetSdkVerion="26"?

Otherwise the Signin Sample scene appears to be working correctly on Android after copying the files manually. I'm able to sign in and out.

Signing in silently while already signed in worked, but I did get an exception when I tried to sign in silently after signing out, which I didn't expect. If I have previously signed into the app, silent sign in should work shouldn't it?

@claywilkinson
Copy link
Contributor

Version 1.0.2 fixes the re-sign-in problem. You can now sign in and out multiple times.

The plugin does not require 26, but is targeting 26. This affects how the compatibility behavior for newer versions of Android. Where do you get the error and what is the exact error? How did you work around it? I think it is reasonable to update the plugin, if it is causing problems. As a general rule, you should set the minSDK to the lowest version of Android the application is compatible with, and the targetSDK should be set to the latest.

@tantzygames
Copy link
Author

Thanks very much Clay,

With the Target API Level in Unity set to Android 7.1 (level 25) the error occurs when building. The error doesn't occur with the Firebase API's because they don't include a targetSdkVersion. The solution was to set the Target API Level in Unity to Automatic (Highest Installed).

The error is:
CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
C:\Program Files\Java\jdk1.8.0_45\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/Jonny/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity201711\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[

]
stdout[
[Temp\StagingArea\AndroidManifest-main.xml, D:\Unity\Project\Temp\StagingArea\android-libraries\firebase-analytics-impl-11.4.2\AndroidManifest.xml:12] Skipping identical /manifest/application/service[@name=com.google.android.gms.measurement.AppMeasurementService] element.
[Temp\StagingArea\AndroidManifest-main.xml, D:\Unity\Project\Temp\StagingArea\android-libraries\firebase-analytics-impl-11.4.2\AndroidManifest.xml:10] Skipping identical /manifest/application/receiver[@name=com.google.android.gms.measurement.AppMeasurementReceiver] element.
Warning: [Temp\StagingArea\AndroidManifest-main.xml:12, D:\Unity\Project\Temp\StagingArea\android-libraries\google-signin-support-1.0.1\AndroidManifest.xml:3] Main manifest has but library uses targetSdkVersion='26'
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()

@claywilkinson
Copy link
Contributor

@Kretin1 - I just re-read your original comment. Apologies for subjecting you to this pain! The prebuild .unitypackage is available on the Releases tab. You can download it from there.

I'll make that more clear in the README.

@tantzygames
Copy link
Author

Thank you Clay, I completely missed that. Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants