Skip to content
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

Can't add package: string indices must be integers #50

Closed
brunoleos opened this issue Jan 18, 2017 · 15 comments
Closed

Can't add package: string indices must be integers #50

brunoleos opened this issue Jan 18, 2017 · 15 comments

Comments

@brunoleos
Copy link

I get the following error as a popup window and at the Editor console when trying to drag&drop a release package to my project packages, in Project Manager: (tested with Unity 5.4.2f2 and different releases and different projects)

PrjCommandException: Error occurred during 'Installing release '<name_of_package>': string indices must be integers

Projeny.Internal.PrjCommandHandler+d__3.MoveNext ()
Projeny.Internal.CoRoutine.Pump ()
Rethrow as CoRoutineException: Coroutine Object Trace: PmDragDropHandler -> PrjCommandHandler
Projeny.Internal.CoRoutine.Pump ()
Projeny.Internal.AsyncProcessor.AdvanceFrameAll ()
Rethrow as AsyncOperationException: Error occurred during async operation
Projeny.Internal.AsyncProcessor.AdvanceFrameAll ()
Projeny.Internal.AsyncProcessor.Tick ()
Projeny.Internal.PmCompositionRoot.Update ()
Projeny.Internal.PmWindow.Update ()
UnityEngine.Debug:LogException(Exception)
Projeny.Internal.Log:ErrorException(Exception)
Projeny.Internal.PmWindow:OnErrorOccurred(Exception)
Projeny.Internal.PmWindow:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

@svermeulen
Copy link
Contributor

Does this happen with every release? I'm not seeing this when I try it.

@brunoleos
Copy link
Author

brunoleos commented Jan 18, 2017

Yes, every release. They're shown in the left pane, and I checked the unitypackages in my filesystem; they're there.

Don't know if it is obvious, but seems to be from Python.

I've tested in the sample projects and in the one I'm setting up.

Maybe another issue with my Unity version? How could I debug it?

@svermeulen
Copy link
Contributor

Can you reproduce this again and then attach PrjLog.txt? Should be in your root folder I think

@brunoleos
Copy link
Author

The log:

Started EditorApi with arguments: D:\Bruno\Documents\Unity5\Projeny\projeny\Projeny.yaml AllMovers windows installRelease 12047 [SharedUnityPackagesDir] 117870
Installing release '12047' into package dir '[SharedUnityPackagesDir]' with version code '117870'
Attempting to install release with ID '12047' into package root '[SharedUnityPackagesDir]' and version code '117870'


Initializing release source for local folder...


Initializing release source for local folder "C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store"
Found 0 released in folder 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store'
Finished initializing release source for local folder (Took 0.0 seconds, time: 19:37:06, total elapsed: 0.0 seconds)


Initializing release source for local folder...


Initializing release source for local folder "C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x"
Found 19 released in folder 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x'
Finished initializing release source for local folder (Took 0.0 seconds, time: 19:37:06, total elapsed: 0.0 seconds)
Finished initializing Release Source Manager, found 19 releases in total


Installing release 'Log Viewer' (version 1.5)...


Loading schema at path "D:\Bruno\Documents\Unity5\Projeny\projeny\UnityProjects\AllMovers\ProjenyProject.yaml"


Extracting 'Log Viewer.unitypackage'...


Extracting unity package at path 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x\dreammakersgroup\Scripting\Log Viewer.unitypackage'
Using temp directory 'C:\Users\BRUNO~1.SCH\AppData\Local\Temp\tmps4mlj4h4'
Deleting temporary directory
Failed during task: extracting 'Log Viewer.unitypackage' (Took 0.0 seconds, time: 19:37:06, total elapsed: 0.0 seconds)
Failed during task: installing release 'Log Viewer' (version 1.5) (Took 0.0 seconds, time: 19:37:06, total elapsed: 0.0 seconds)
string indices must be integers

@svermeulen
Copy link
Contributor

svermeulen commented Jan 18, 2017

I don't know why it's happening, and the log isn't providing enough info. I assume you are running from exe? If you run from python source directly (as described in installation section), the log would be more helpful

@brunoleos
Copy link
Author

I've just installed Python and the dependencies needed, and then opened the solution and compiled in Release configuration, and added the bat files path to my Windows path, and when I try to open the Package Manager I get the following error:

PrjCommandException: Error occurred during 'Looking up release list': Traceback (most recent call last):

File "C:\Users\bruno.schneider\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main

"__main__", mod_spec)

File "C:\Users\bruno.schneider\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code

exec(code, run_globals)

File "D:\Bruno\Documents\Projeny\Source\prj\main\EditorApi.py", line 5, in

import prj.main.Prj as Prj

File "D:\Bruno\Documents\Projeny\Source\prj\main\Prj.py", line 21, in

from prj.main.VisualStudioHelper import VisualStudioHelper

File "D:\Bruno\Documents\Projeny\Source\prj\main\VisualStudioHelper.py", line 10, in

import win32api

ImportError: DLL load failed: %1 não é um aplicativo Win32 válido.

Projeny.Internal.PrjCommandHandler+d__3.MoveNext ()
Projeny.Internal.CoRoutine.Pump ()
Rethrow as CoRoutineException: Coroutine Object Trace: PmReleasesHandler -> PrjCommandHandler
Projeny.Internal.CoRoutine.Pump ()
Projeny.Internal.AsyncProcessor.AdvanceFrameAll ()
Rethrow as AsyncOperationException: Error occurred during async operation
Projeny.Internal.AsyncProcessor.AdvanceFrameAll ()
Projeny.Internal.AsyncProcessor.Tick ()
Projeny.Internal.PmCompositionRoot.Update ()
Projeny.Internal.PmWindow.Update ()
UnityEngine.Debug:LogException(Exception)
Projeny.Internal.Log:ErrorException(Exception)
Projeny.Internal.PmWindow:OnErrorOccurred(Exception)
Projeny.Internal.PmWindow:Update()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

@svermeulen
Copy link
Contributor

Did you install the windows extensions for python? You can get them here

@brunoleos
Copy link
Author

Well, I installed, but it was weird. I first installed Python 3.6 x64, and then tried installing the x64 version of the Extensions, pywin32-220.win-amd64-py3.6.exe, but this installer couldn't find the Python installation and couldn't succeed. Then I tried installing the x86 version of the Extensions, pywin32-220.win32-py3.6.exe, and it succedded. So I have mixed Python 3.6 x64 with x86 extensions, which seems to be no good.

I'm going to uninstall everything and install the x86 version of everything to see what I get.

@brunoleos
Copy link
Author

I could set up Python now. It seems there is a problem with the releases of build 220 of the Extensions.

The log now is:

Started EditorApi with arguments: D:\Bruno\Documents\Unity5\Projeny\projeny\Projeny.yaml AllMovers windows installRelease 12047 [SharedUnityPackagesDir] 117870
Installing release '12047' into package dir '[SharedUnityPackagesDir]' with version code '117870'
Attempting to install release with ID '12047' into package root '[SharedUnityPackagesDir]' and version code '117870'
--------------------------
Initializing release source for local folder...
--------------------------
Initializing release source for local folder "C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store"
Found 0 released in folder 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store'
Finished initializing release source for local folder (Took 0.0 seconds, time: 10:47:39, total elapsed: 0.0 seconds)
--------------------------
Initializing release source for local folder...
--------------------------
Initializing release source for local folder "C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x"
Found 19 released in folder 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x'
Finished initializing release source for local folder (Took 0.0 seconds, time: 10:47:39, total elapsed: 0.0 seconds)
Finished initializing Release Source Manager, found 19 releases in total
--------------------------
Installing release 'Log Viewer' (version 1.5)...
--------------------------
Loading schema at path "D:\Bruno\Documents\Unity5\Projeny\projeny\UnityProjects\AllMovers\ProjenyProject.yaml"
--------------------------
Extracting 'Log Viewer.unitypackage'...
--------------------------
Extracting unity package at path 'C:\Users\bruno.schneider\AppData\Roaming\Unity\Asset Store-5.x\dreammakersgroup\Scripting\Log Viewer.unitypackage'
Using temp directory 'C:\Users\BRUNO~1.SCH\AppData\Local\Temp\tmplxfsxysw'
Deleting temporary directory
Failed during task:  extracting 'Log Viewer.unitypackage' (Took 0.0 seconds, time: 10:47:39, total elapsed: 0.0 seconds)
Failed during task:  installing release 'Log Viewer' (version 1.5) (Took 0.0 seconds, time: 10:47:39, total elapsed: 0.0 seconds)
string indices must be integers

Traceback (most recent call last):
  File "D:\Bruno\Documents\Projeny\Source\prj\main\EditorApi.py", line 43, in run
    self._runInternal()
  File "D:\Bruno\Documents\Projeny\Source\prj\main\EditorApi.py", line 108, in _runInternal
    self._releaseSourceManager.installReleaseById(releaseName, self._project, packageRoot, versionCode, True)
  File "D:\Bruno\Documents\Projeny\Source\prj\reg\ReleaseSourceManager.py", line 135, in installReleaseById
    self._installReleaseInternal(projectName, packageRoot, releaseInfo, releaseSource, suppressPrompts)
  File "D:\Bruno\Documents\Projeny\Source\prj\reg\ReleaseSourceManager.py", line 171, in _installReleaseInternal
    installDirName = releaseSource.installRelease(packageRoot, releaseInfo, installDirName)
  File "D:\Bruno\Documents\Projeny\Source\prj\reg\AssetStoreCacheReleaseSource.py", line 35, in installRelease
    return subReg.installRelease(packageRoot, releaseInfo, forcedName)
  File "D:\Bruno\Documents\Projeny\Source\prj\reg\LocalFolderReleaseSource.py", line 50, in installRelease
    return self._extractor.extractUnityPackage(packageRootDir, fileInfo.path, releaseInfo.name, forcedName)
  File "D:\Bruno\Documents\Projeny\Source\prj\reg\UnityPackageExtractor.py", line 43, in extractUnityPackage
    self._sys.executeAndWait('"[UnityExePath]" -batchmode -nographics -quit -projectPath "{0}" -importPackage "{1}"'.format(tempDir, unityPackagePath))
  File "D:\Bruno\Documents\Projeny\Source\mtm\util\SystemHelper.py", line 48, in executeAndWait
    expandedStr = self._varManager.expand(commandStr)
  File "D:\Bruno\Documents\Projeny\Source\mtm\util\VarManager.py", line 88, in expand
    replacement = self.get(var)
  File "D:\Bruno\Documents\Projeny\Source\mtm\util\VarManager.py", line 47, in get
    return self._config.getString('PathVars', key)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 33, in getString
    return self._getPrimitive(str, *args)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 45, in _getPrimitive
    result = self._tryGetPrimitive(None, propType, *args)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 50, in _tryGetPrimitive
    result = self.tryGet(*args)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 65, in tryGet
    matches = self.getAll(*args)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 84, in getAll
    result = self._getAllInternal(*args)
  File "D:\Bruno\Documents\Projeny\Source\mtm\config\Config.py", line 105, in _getAllInternal
    result.append(currentDict[name])
TypeError: string indices must be integers

@svermeulen
Copy link
Contributor

Yep that's what I was looking for (a python stack trace).

Looks like its failing when expanding [UnityExePath]. Can you show me whatever Projeny.yaml config files you're using? The one in the home directory, and also any ones you've added to the samples (if you changed any there)

@brunoleos
Copy link
Author

I have this at home:

PathVars:
    UnityExePath:'C:/Program Files/Unity 5.4.2f2/Editor/Unity.exe'

And the samples has this:

ProjectAliases:
    am: AllMovers
    cm: CubeMover
    sm: SphereMover

PathVars:
    UnityProjectsDir: '[ConfigDir]/UnityProjects'
    SharedUnityPackagesDir: '[ConfigDir]/UnityPackages'
    LogPath: '[ConfigDir]/PrjLog.txt'
    VisualStudioIdePath: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe'

@svermeulen
Copy link
Contributor

Oh wow. All you need to do is add a space after the 'UnityExePath:' in your custom Projeny.yaml

I've updated it to print out a more useful error for next time

@svermeulen
Copy link
Contributor

The YAML parser can't recognize it as a dictionary otherwise apparently

svermeulen added a commit that referenced this issue Jan 20, 2017
@brunoleos
Copy link
Author

Man, that's it, we needed some space there.

I'm glad we solved it. Nevertheless it was a long path, the documentation of Projeny is very good and useful, and your close support is awesome.

I've just tried creating a dependency to a package from a third-party not from Asset Store. This package needs to put files and folders in the root of Assets and Plugins, as if I have added it the Unity way. Using the Package Manager, a folder with the name of the package is created, and the content is added there.

For example, the package has a Javascript file that needs to be at Assets/Plugins/Editor. But with Package Manager, it goes to Assets//Plugins/Editor, breaking the reference.

Is it an issue with the package? Or maybe a situation that Projeny should know how to override?

@svermeulen
Copy link
Contributor

Yes, that is a limitation of the design of Projeny. Everything must be in package folders so that the directory links can work. You can't put files directly underneath Assets or Plugins. In almost all cases though, this works fine. If a third party library assumes an absolute path, then the third party library needs to be changed for it to be compatible with projeny.

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