question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Workspace organization

See original GitHub issue

Hi,

I’m trying to setup my workspace but I’m finding some issues. I have read many related issues but none seem to point me in the right direction and I’m hitting a wall.

My current situation is as follows:

  • We have 5 games, each game is on 4 platforms (iOS, Android, Browser, Steam)
  • And we have 5 different libraries:
  1. MainEngine (contains 99% of all the code in our projects)
  2. AirLibrary (used by mobile and Steam games, contains code linked to some ANEs and AIR specific code)
  3. MobileLibrary (used by all mobile games, contains code linked to mobile-specific ANEs)
  4. SteamLibrary (used by Steam games, contains code linked to Steam-specific ANEs)
  5. BrowserLibrary (used by browser projects)

We did separate these libraries in projects when using Flash Builder because of their sdk nature.

Our current workspace on FlashBuilder was quite heavy, each library and each game platform is a project, so: 5 games x 4 platforms + 5 libraries = 25 projects.

My intention using VS was to have it all clean and tidy, my current setup is the following:

1 - I created one workspace per library so that’s 5 VS projects, so far so good. 2 - I think it would be nice to have 1 workspace per game and have 4 folders inside, one per platform so something like this:

image

Inside of each of the platform folders I have their bin and src folders. On the workspace root I created one asconfig.json per platform as well as a default asconfig.json for the workspace itself. Also, the launch.json file contains all the setups for each platform, which is awesome.

My intention is to be able to debug the games and be able to access (or set breakpoints on) the source code of my libraries, so the only way that I believe I have to access it is by adding their src folders into the source-path compiler option.

I have been playing around for a while and my current setup allows me to launch/debug every platform just fine, the problem comes when I try to access any .as file of any of the previously attached sources.

I had to add this to asconfig.json in order to reach my current state:

{
	"compilerOptions": {
		"accessible": true,
		"source-path": [
                 "../TCGEngine/src",
                 "../FSMobileLibrary/src",
                 "../FSAirLibrary/src",
                 "../FSBrowserLibrary/src",
		"../TCGEngine/media",
                 "media",
		"media_on_demand",
		"media_project",
		"media_on_demand_project"
        ],
        "library-path": [
		"../TCGEngine/bin/TCGEngine.swc",
		"../FSMobileLibrary/bin/FSMobileLibrary.swc",
		"../FSAirLibrary/bin/FSAirLibrary.swc",
		"../FSBrowserLibrary/bin/FSBrowserLibrary.swc",
		"../TCGEngine/libs_browser",
		"../TCGEngine/libs",
		"../TCGEngine/anes/steam/FRESteamWorks.ane",
		"../TCGEngine/anes/common/com.distriqt.Application.ane",
		"../TCGEngine/anes/common/com.distriqt.Bolts.ane",
		"../TCGEngine/anes/common/com.distriqt.Core.ane",
		"../TCGEngine/anes/common/com.distriqt.FacebookAPI.ane",
		"../TCGEngine/anes/common/com.distriqt.Firebase.ane",
		"../TCGEngine/anes/common/com.distriqt.InAppBilling.ane",
		"../TCGEngine/anes/common/com.distriqt.Notifications.ane",
		"../TCGEngine/anes/common/com.distriqt.Share.ane",
		"../TCGEngine/anes/common/com.distriqt.Vibration.ane",
		"../TCGEngine/anes/common/com.distriqt.PushNotifications.FCM.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.V4.ane",
		"../TCGEngine/anes/android/com.distriqt.playservices.Auth.ane",
		"../TCGEngine/anes/android/com.distriqt.playservices.Base.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.AppCompatV7.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.CardViewV7.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.CustomTabs.ane",
		"../TCGEngine/anes/android/com.distriqt.ExpansionFiles.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.Design.ane",
		"../TCGEngine/anes/android/com.distriqt.androidsupport.RecyclerViewV7.ane"
		],
	},
	"files": [
        "src/MainEmpty.as"
	],
	"config": "airmobile"
}

As you can see to make this work I have also had to create a src/MainEmpty class which does simply nothing, it’s empty.

I can (sometimes!) access the classes of the libraries, some other times I start getting errors (up to 30k+) and after deleting a blank space and saving the workspace they banish, not quite sure what’s going on to be honest. Also, from time to time when Pressing Ctrl + T to access an actionscript source class the class itself seems to be extracted from an already compiled swc which only shows me the headers of the functions in it, quite weird.

Sample of an error:

com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2214)
	at com.google.common.cache.LocalCache.get(LocalCache.java:4053)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4992)
	at org.apache.royale.compiler.internal.projects.CompilerProject.getCacheForScope(CompilerProject.java:676)
	at org.apache.royale.compiler.internal.scopes.ASScope.findPropertyQualified(ASScope.java:1592)
	at org.apache.royale.compiler.internal.definitions.references.ResolvedQualifiersReference.resolve(ResolvedQualifiersReference.java:80)
	at org.apache.royale.compiler.internal.definitions.DefinitionBase.resolveType(DefinitionBase.java:1062)
	at org.apache.royale.compiler.internal.definitions.DefinitionBase.resolveType(DefinitionBase.java:1102)
	at org.apache.royale.compiler.internal.definitions.ClassDefinition.resolveBaseClass(ClassDefinition.java:362)
	at org.apache.royale.compiler.internal.definitions.TypeDefinitionBase$TypeIterator.pushChildren(TypeDefinitionBase.java:283)
	at org.apache.royale.compiler.internal.definitions.TypeDefinitionBase$TypeIterator.next(TypeDefinitionBase.java:217)
	at org.apache.royale.compiler.internal.definitions.TypeDefinitionBase$TypeIterator.next(TypeDefinitionBase.java:175)
	at org.apache.royale.compiler.internal.scopes.TypeScope.getPropertyForMemberAccess(TypeScope.java:322)
	at org.apache.royale.compiler.internal.scopes.ScopeView.getPropertyForMemberAccess(ScopeView.java:81)
	at org.apache.royale.compiler.internal.scopes.ASScope.getPropertyFromDef(ASScope.java:903)
	at org.apache.royale.compiler.internal.scopes.ASScope.getPropertyFromDef(ASScope.java:865)
	at org.apache.royale.compiler.internal.scopes.ASScope.getPropertyFromDef(ASScope.java:784)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolveMemberRef(IdentifierNode.java:924)
	at org.apache.royale.compiler.internal.tree.as.IdentifierNode.resolve(IdentifierNode.java:388)
	at org.apache.royale.compiler.internal.tree.as.MemberAccessExpressionNode.resolve(MemberAccessExpressionNode.java:124)
	at org.apache.royale.compiler.internal.semantics.SemanticUtils.transformNameToConstantValue(SemanticUtils.java:2433)
	at org.apache.royale.compiler.internal.as.codegen.ABCGeneratingReducer.isCompileTimeConstant(ABCGeneratingReducer.java:2458)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.isCompileTimeConstant(CmcEmitter.java:89)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_MemberAccessExpressionID_2.cachedCost_4411a827(CmcEmitter.java:16870)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_MemberAccessExpressionID_2.getCostForRule_309c259f(CmcEmitter.java:16863)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_MemberAccessExpressionID_2.getCost(CmcEmitter.java:16387)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_MemberAccessExpressionID_2.getCost(CmcEmitter.java:16427)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionCallID_2_n.getCostForRule_258246a0(CmcEmitter.java:13084)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionCallID_2_n.getCost(CmcEmitter.java:12747)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionCallID_2_n.getCost(CmcEmitter.java:12802)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionCallID_2_n.getCost(CmcEmitter.java:12780)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.getNaryCost(CmcEmitter.java:39385)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.access$000(CmcEmitter.java:29)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_BlockID_0_n.getCost(CmcEmitter.java:10495)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_ElseID_1.getCostForRule_6566400(CmcEmitter.java:11691)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_ElseID_1.getCost(CmcEmitter.java:11631)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.getNaryCost(CmcEmitter.java:39385)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.access$000(CmcEmitter.java:29)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_IfStatementID_1_n.getCostForRule_37a74188(CmcEmitter.java:14281)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_IfStatementID_1_n.getCost(CmcEmitter.java:14218)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.getNaryCost(CmcEmitter.java:39385)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.access$000(CmcEmitter.java:29)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_BlockID_0_n.getCost(CmcEmitter.java:10495)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionID_4.getCostForRule_2164c72(CmcEmitter.java:13441)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter$JBurgAnnotation_FunctionID_4.getRule(CmcEmitter.java:13373)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduceAntecedent(CmcEmitter.java:39111)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.reduce(CmcEmitter.java:39103)
	at org.apache.royale.compiler.internal.as.codegen.CmcEmitter.burm(CmcEmitter.java:39405)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateInstructions(ABCGenerator.java:233)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:398)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateMethodBodyForFunction(ABCGenerator.java:352)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generateFunction(ABCGenerator.java:267)
	at org.apache.royale.compiler.internal.as.codegen.ClassDirectiveProcessor.declareFunction(ClassDirectiveProcessor.java:886)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:219)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:193)
	at org.apache.royale.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareClass(GlobalDirectiveProcessor.java:429)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:211)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:193)
	at org.apache.royale.compiler.internal.as.codegen.GlobalDirectiveProcessor.declarePackage(GlobalDirectiveProcessor.java:455)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:228)
	at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:193)
	at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:124)
	at org.apache.royale.compiler.internal.units.ASCompilationUnit.handleABCBytesRequest(ASCompilationUnit.java:394)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:875)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:108)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:312)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:308)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor$CallerRunsPolicy.rejectedExecution(ThreadPoolExecutor.java:2022)
	at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:823)
	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1369)
	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker.getRequest(RequestMaker.java:188)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.getABCBytesRequest(CompilationUnitBase.java:623)
	at org.apache.royale.compiler.internal.units.ASCompilationUnit.handleOutgoingDependenciesRequest(ASCompilationUnit.java:476)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.processOutgoingDependenciesRequest(CompilationUnitBase.java:891)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$500(CompilationUnitBase.java:108)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:387)
	at org.apache.royale.compiler.internal.units.CompilationUnitBase$6$1.call(CompilationUnitBase.java:383)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
	at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:770)
	at com.google.common.cache.LocalCache.get(LocalCache.java:4052)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4057)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4986)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4992)
	at org.apache.royale.compiler.internal.scopes.ASProjectScope.addScopeToCompilationUnitScopeList(ASProjectScope.java:1310)
	at org.apache.royale.compiler.internal.projects.CompilerProject$ScopeCacheLoader.load(CompilerProject.java:107)
	at org.apache.royale.compiler.internal.projects.CompilerProject$ScopeCacheLoader.load(CompilerProject.java:96)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3628)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2336)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2295)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2208)
	... 88 more

Any ideas of what could I do to make this work? I don’t care if I have to separate each platform into a separate VS project, I tried it already but still found the same errors though.

Any help will be appreciated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
joshtynjalacommented, Jun 21, 2019

With a complex project structure like that, it’s likely that you are running into some known issues in version 0.9.4 of the Apache Royale compiler. This is the current version included with the VSCode extension to power the code intelligence (even for projects that use other SDKs).

The issues have been fixed in the upcoming version 0.9.6 of Royale. I plan to include this update as soon as it is released. However, you can start using it today by downloading the SDK and changing a setting in VSCode, of you’d like.

Go here: https://royale.apache.org/download/

Find the “JSOnly Nightly Build” near the bottom of the page. Download apache-royale-0.9.6-bin-js.zip on Windows or apache-royale-0.9.6-bin-js.tar.gz on macOS, and extract it somewhere.

In VSCode, set the as3mxml.sdk.editor setting to the royale-asjs folder inside the unzipped SDK. Note that this is different from the as3mxml.sdk.framework setting that you use to point to your project’s SDK.

1reaction
cgasconscommented, Jun 25, 2019

@joshtynjala This is so far looking promising indeed, I just downloaded the new package and seems to be working fine! I will let you know if I run into more related issues. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

280 Workspace Organization ideas - Pinterest
May 23, 2019 - Explore Live Simply Method's board "Workspace Organization " ... See more ideas about organization, office inspiration, craft room office....
Read more >
30 Easy Desk Organization Ideas - Good Housekeeping
Creating the perfect home office can be easy, thanks to genius DIY storage solutions, desk organization ideas, and products to keep your ...
Read more >
Workspace & Desk Organization Ideas - The Container Store
Learn how to organize your desk and workspace with directions, videos and advice from The Container Store's experts, and get free shipping on...
Read more >
19 Office Organization Ideas In 2022 For Best Productivity
Looking to revamp your workspace in 2022? These are the top tricks, tips, and hacks to increase your productivity and office wellbeing.
Read more >
11 Beautiful Home Offices That Are Neat and Organized
Here are 11 home office organization ideas to take your workspace from chaotic to clutter-free. 1:10. Click Play for Tips to Create an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found