Keystore not working on unity 2017.1 - unity3d

our team started to work on an old project to fix bugs and add new features. But we have a problem on the keystore file. After project updated to Unity 2017 we started to get an error that says:
CommandInvokationFailure: Failed to sign APK package.
/Users/work/Library/Android/sdk/build-tools/26.0.2/apksigner sign --ks
"/Users/work/Desktop/work game/MAIN/game.keystore" --ks-pass
pass:"***" --ks-key-alias "***" --key-pass pass:"***" "/Users/work/Desktop/work/game/MAIN/Temp/StagingArea/Package.apk"
stderr[
Failed to load signer "signer #1"
java.io.IOException: DerInputStream.getLength(): lengthTag=109, too big.
at java.base/sun.security.util.DerInputStream.getLength(DerInputStream.java:606)
at java.base/sun.security.util.DerValue.init(DerValue.java:390)
at java.base/sun.security.util.DerValue.<init>(DerValue.java:331)
at java.base/sun.security.util.DerValue.<init>(DerValue.java:344)
at java.base/sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1953)
at java.base/sun.security.util.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:222)
at java.base/java.security.KeyStore.load(KeyStore.java:1479)
at com.android.apksigner.ApkSignerTool$SignerParams.loadKeyStoreFromFile(ApkSignerTool.java:829)
at com.android.apksigner.ApkSignerTool$SignerParams.loadPrivateKeyAndCertsFromKeyStore(ApkSignerTool.java:719)
at com.android.apksigner.ApkSignerTool$SignerParams.loadPrivateKeyAndCerts(ApkSignerTool.java:659)
at com.android.apksigner.ApkSignerTool$SignerParams.access$500(ApkSignerTool.java:611)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:266)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:89)
]
stdout[
]
exit code: 2
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.TasksCommon.Exec (System.String command, System.String args, System.String workingdir, System.String errorMsg)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.SignPackage (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.Tasks.BuildAPK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.HostView:OnGUI()
Tried with different JDK versions. Changed keystore name, its destination but still same result. The same keystore works on Unity 5.6 perfectly. The update should be published soon. Solving the problem as soon as possible is crucial for us.

Under Publishing Settings, try changing the Build System to Gradle (New) instead of Internal (Default).
If above not work try updating Android Studio and also update the android SDK.
If above not working try below steps
1) just open https://developer.android.com/studio/index.html
2) scroll down to the bottom of that page
3) go to downloads
4) scroll down to the bottom of that page
5) find Windows "tools_r25.2.3-windows.zip" download and unzip it
5) find MacOSX "tools_r25.2.3-macosx.zip" download and unzip it.
6) In the SDK path replace the tools folder.
Original source link

Related

While Creating Build for facebook sign up for Android in unity I am facing some errors

While creating Build with facebook SDK 13.2. I am facing some errors which says
Exception: Cannot include plugin 'Assets/FacebookSDK/Plugins/Windows/x64/zlib1.dll' (Key: zlib1.dll;None) since plugin with the same name and architecture was already added ('Assets/FacebookSDK/Plugins/Windows/x86/zlib1.dll (Architecture: None)').
UnityEditor.Android.AndroidBuildPostprocessor.CollectPlugin (System.String path, Unity.Android.Types.AndroidArchitecture architecture, System.Collections.Generic.Dictionary`2[TKey,TValue] pluginContainer) (at :0)
UnityEditor.Android.AndroidBuildPostprocessor.PluginsDataFor (UnityEditor.Modules.BuildPostProcessArgs args) (at :0)
is there anyone faced same sort of issue and any solutions??enter image description here
You will need to delete some of the folders from FacebookSDK/Plugins - https://github.com/facebook/facebook-sdk-for-unity/wiki/FAQ---Troubleshooting-Unity-SDK-14.0.0
e.g. If you are building for iOS you can delete the Windows plugin folder

System.IO.ports works in Unity but not in build

I threw together a little application in Unity which needs to access a serial port. Since Unity does not include System.IO.Ports I installed the NugetPackage with NugetForUnity. Everything works fine in the engine but if I build the project it somehow can't use System.IO.Ports anymore.
NotSupportedException: System.IO.Ports.SerialPort::.ctor
at System.IO.Ports.SerialPort..ctor (System.String portName, System.Int32 baudRate, System.IO.Ports.Parity parity, System.Int32 dataBits, System.IO.Ports.StopBits stopBits) [0x00000] in <00000000000000000000000000000000>:0
at GetInput.Start () [0x00000] in <00000000000000000000000000000000>:0
I got it to work by changing the "Scripting Backend" to "Mono" and building the solution in Visual Studio.

Unity3d : can't add script component in the gameobject because of C# Native Integration

Everytime I try to add new script to any prefab Im getting this message
"Can't add script component because the script class cannot be found. Make sure there are no compile errors"
And yes the file name matches.
I'm using the latest version currently 2018.3.5f1
I was using recently "Unity C# 5.0 and 6.0 Integration" from here
because I was having this kind of error in the console
"error CS1644: cannot be used, because it is not part of the C# 4.0 language specification."
After that not knowing how to uninstall this I removed the folder and reimported the asset
Now I'm having this error which causing me the script component add, supposedly
UnityEditor.Scripting.Compilers.ScriptCompilerBase.BeginCompiling () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:60)
UnityEditor.Scripting.ScriptCompilation.CompilationTask.QueuePendingAssemblies () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:228)
UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:135)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileScriptAssemblies (UnityEditor.Scripting.ScriptCompilation.ScriptAssembly[] scriptAssemblies, UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings, System.String tempBuildDirectory, EditorScriptCompilationOptions options, CompilationTaskOptions compilationTaskOptions, CompileScriptAssembliesOptions compileScriptAssembliesOptions) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1133)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies (UnityEditor.Scripting.ScriptCompilation.ScriptAssemblySettings scriptAssemblySettings, System.String tempBuildDirectory, EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1045)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.CompileCustomScriptAssemblies (EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:1039)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface+c__AnonStorey4.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:277)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.EmitExceptionAsError[Boolean] (System.Func`1 func, Boolean returnValue) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:97)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:CompileCustomScriptAssemblies(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)
Any ideas ?
I had to export my asset package
Reinstall unity
Create new project folder
And Import the asset, the error are gone turn out my folder was the issue

Cannot build Unity project from command line on fresh git cloned repository

I am looking to build Unity project just after git cloning them. However when they are "fresh" (only not giignored files) the build is very short and has no output. I have to open once the project with Unity Editor to make the build command line working.
Build command line:
D:/------/Unity.exe -quit -batchmode -logFile uniytBuildLog.txt -buildTarget Win64 -executeMethod AutoBuilder.PerformBuild -appName test.exe -buildFolder "./Build/"
End of build log that seems to be a succes despite a strange error
Reloading assemblies after script compilation.
Begin MonoManager ReloadAssembly
Refreshing native plugins compatible for Editor in 3.09 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.15 ms.
Mono: successfully reloaded assembly
Refreshing native plugins compatible for Editor in 0.79 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.11 ms.
----- Total AssetImport time: 0.130863s, AssetImport time: 0.000000s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
- Completed reload, in 1.564 seconds
Initializing Unity.PackageManager (PackageManager) v2017.2.1 for Unity v2017.2.1f1
Registering platform support modules:
Registered platform support modules in: 0.0496396s.
Native extension for OSXStandalone target not found
Native extension for WindowsStandalone target not found
Native extension for LinuxStandalone target not found
Native extension for WebGL target not found
Native extension for Metro target not found
Native extension for iOS target not found
Native extension for Android target not found
Batchmode quit successfully invoked - shutting down!
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.046037 seconds (Nothing changed)
Updating ProjectSettings/ProjectSettings.asset - GUID: 00000000000000004000000000000000...
done. [Time: 61.503121 ms]
Refreshing native plugins compatible for Editor in 1.32 ms, found 7 plugins.
Preloading 2 native plugins for Editor in 0.12 ms.
----- Total AssetImport time: 0.196505s, AssetImport time: 0.107053s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]
Refresh: detecting if any assets need to be imported or removed ... Refresh: elapses 0.032108 seconds (Nothing changed)
[Package Manager] Server::Kill -- Server was shutdown
Cleanup mono
[usbmuxd] Stop listen thread
[usbmuxd] Listen thread exiting
Exiting batchmode successfully now!
Unhandled Exception: System.IO.DirectoryNotFoundException: Directory 'C:\Users\Ben\AppData\Local\Temp\160279e2' not found.
at System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs) [0x000f7] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:514
at System.IO.Directory.GetDirectories (System.String path, System.String searchPattern) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:275
at System.IO.Directory.GetDirectories (System.String path) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:270
at System.IO.Directory.RecursiveDelete (System.String path) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:186
at System.IO.Directory.Delete (System.String path, Boolean recursive) [0x0000c] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:205
at System.CodeDom.Compiler.TempFileCollection.Delete () [0x00000] in <filename unknown>:0
at System.CodeDom.Compiler.TempFileCollection.Dispose (Boolean disposing) [0x00000] in <filename unknown>:0
at System.CodeDom.Compiler.TempFileCollection.Finalize () [0x00000] in <filename unknown>:0
debugger-agent: Unable to listen on 3896
One of the problem was due to the lack of the argument with the project path.
I was thinking that skipping this argument would use the project in the current directory but it uses instead the last opened project so it was not building the right one until I open it with the Editor.

Facebook.Unity.Gameroom.dll was not registered

Unity3D version 2017.1.1f1
Whenever I launch Unity, I get the following error:
Assertion failed: Extension
Library/FacebookSDK/Facebook.Unity.Gameroom.dll was not registered,
that means it relies on default UnityExtensions settings, please
register extension and apply necessary settings for it in the
callback. I tried deleting the Library folder but the problem is still
there and the file Facebook.Unity.Gameroom.dll also exists.
Also when I try to build for WebGL, 3 more errors are shown and build fails. The first one is as follows:
ArgumentException: The Assembly Facebook.Unity is referenced by
Facebook.Unity.Gameroom
('Library/FacebookSDK/Facebook.Unity.Gameroom.dll'). But the dll is
not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse
(System.String assemblyPath, System.Collections.Generic.List1
alreadyFoundAssemblies, System.String[] allAssemblyPaths,
System.String[] foldersToSearch,
System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at
C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:142)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[]
paths, System.String[] foldersToSearch, BuildTarget target) (at
C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:179)
UnityEditor.HostView:OnGUI()
How can I solve this?