SapphireSteel Forum
Welcome, Guest. Please login or register.
July 20, 2017, 10:30:38 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Sapphire and Amethyst IDEs
4074 Posts in 848 Topics by 708 Members
Latest Member: dcham_inbsys
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Amethyst
| | |-+  Need help getting set up with Amethyst 2
« previous next »
Pages: [1] Print
Author Topic: Need help getting set up with Amethyst 2  (Read 5011 times)
idleBishop
Newbie
*
Posts: 10


« on: August 13, 2014, 11:19:39 PM »

I watched the tutorial videos and it seems like most of them are for a version of Amethyst earlier than what is currently available. I'm having several issues, so I'll try itemizing them here instead of creating a ton of threads.

Btw, I'm trying to set up an AS3 Mobile project.

PROJECT CREATION ISSUES

1) The Amethyst installation failed to find the "SDK" on install. The tutorial just puts it at the root of c:/ and says Amethyst "should just find it". It did not find my installation, and finding where to manually set it was really cumbersome. It should really say "Flex SDK" since that's all it will work with apparently. Pointing it an an AIR SDK fails completely.

2) When creating a new mobile AS3 project, the generated project has 2 issues:
    * The app descriptor xml defaults to version 3.7 which doesn't make sense because the FLEX SDK I pointed it to requires 3.4... figuring that out took a while, but it needs to be fixed.
    * The app descriptor xml does not include a <visible>true</visible> tag which prevents the app from launching initially.

ACTUAL QUESTIONS

1) How do you include an external code library into a project? The video on the subject only says "Right click the project->Add library project", but this option does not exist in Amethyst 2, and trying to use the "Paths->Source Paths" or "Paths->"Library paths" section of the project properties does not work. The closest I can get is right click -> Add Files As Links, which puts the files into my project, but the compiler does not recognize them. I only get a bunch of "Type not found" and "Undefined property" errors listing the code I'm trying to use.

2) How do I change my FLEX SDK version for a project? I tried "Tools->Options->Project->Amethyst Default SDK Path" as well as right clicking my project and manually setting it in the Application section, but even with a completely new project, the project fails to run. I just get some ambiguous error like:
*** abnormal process termination
*** exit code: 9
   error while loading initial content

If I try to change the app description version number to what should correspond to my desired SDK, I just get the following error:



3) How do I create a keystore for Android using the Deploy->Android->Keystore option? Every time I try, I just get the following error.

« Last Edit: August 13, 2014, 11:40:13 PM by idleBishop » Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #1 on: August 14, 2014, 04:04:02 PM »

Ok.

I'll try and answer a couple of your questions now and the others a bit later. So, in no particular order ...

1) Yes, the tutorials are a little out of date and we should produce some new ones.

2) the version of the AIR namespace is a little tricky. Basically, the SDK that we recommend is the last one produced by Adobe before they stopped supporting Flex and gave it over to Apache. Apache have produced several point upgrades since then, but none (in my view) actually add anything significant - and in particular the Apache SDK doesn't include the AIR compiler. Some bugs have been fixed, but there doesn't seem to be much in the way of new features, though I haven't checked for a while now. At any rate, the Adobe Flex SDK is a known and stable quantity that does the job. However it is way out of date when it comes to AIR, which Adobe continues to update. So the latest AIR compilers need to be got from Adobe and merged into the base Flex SDK. There are tools in Amethyst which help with this - look under Tools | Download SDKs and Runtimes.

2) The <visible>true</visible> is included as far as I can see. This is the template used to create the app descriptor
Code:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/$airversion$">
<id>$safeprojectname$</id>
<versionNumber>0.0.0</versionNumber>
<name>$safeprojectname$</name>
<filename>$safeprojectname$</filename>
<initialWindow>
<content>$safeprojectname$.swf</content>
<visible>true</visible>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<width>400</width>
<height>200</height>
</initialWindow>
</application>

so I'm not sure what's happening there. The current AIR version is (I think 14.0), the version when Amethyst was released is 3.7 so is the default. Adobe keep changing this and it's difficult to keep up with what they are doing. We're certainly not going to release a new version of Amethyst every time Adobe releases a new version of AIR. You can change the default (and many other things) under Tools |Options |Projects and Solutions | Amethyst.

3) The installer should find the SDK. It looks two directories deep in C->G and a couple of other likely places as well, so I don't know why it didn't find it. It does for me.


Dermot

Logged
idleBishop
Newbie
*
Posts: 10


« Reply #2 on: August 14, 2014, 06:42:52 PM »

Thanks for the details. I'm also not sure what happened with the project creation, but <visible> is definitely missing. Adding it wasn't a big deal, but knowing to look for that was a hassle. It's possible that it has something to do with the Flex SDK not being found during the installation. That's probably also related to the 3.4 vs 3.7 discrepancy I get on project creation as well.

Your assessment of the AdobeFlex vs ApacheFlex sounds about right, but telling my Amethyst project to use anything other than the 4.6.0 SDK I've got still fails, which is odd. I'll try making a copy of 4.6.0 and applying AIR 14 to it directly. I did try the "Tools | Download SDKs and Runtimes" option for getting the SDK's but after downloading the SDK, it fails to actually install/unpack it. I tried several times with several different options and I always get the same error claiming there's an "error in moving the folder" or something... and I am definitely an admin running VS2010 with admin privileges. I can include the error if you want, but I'll try the 4.6.0 + AIR 14 combo first.

My main needs at this point are to build with my AIR version of choice, and compile with packages that aren't directly in my project tree (Compiling with Starling source instead of the .swc for example) and I should be good to go. Hopefully we can figure that out soon. Thanks for your help!
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #3 on: August 15, 2014, 12:22:10 PM »

We've found the problem with <visual>true></visual>. It was included in in some but not all of the templates.

On the changing the SDK, you should be able to change it on a project basis is selecting Project | <your project> Properties and then in the Application tab, browsing to the Selected SDK. So I have 'C:\Flex SDKs\flex_sdk_4.6.0.23201B\' as the directory (it must be unzipped of course). If you chose a new SDK, the project will close and re-open. The Tools |Options settings apply to new projects only and will not affect existing projects.

Adding an external code library (i.e. x.swc) is done via the Solution Explorer. If you right click on References, select Add Reference and you will get a browser. Select the swc and you will see it appear as a new item under the References node. It's similar to the way C# works. If you want to build a component library (from source files) you create a new library projctt in the same solution and go from there. Again, it works in a similar way to C# (you have to add a Project reference instead of an swc to the project using the library). With a source library project you get much better source code navigation, etc.

On the other problems, you need to look in the Output Window (under Build) for more information. If all is well, you should see things like this
Quote
------ Build started: Project: MobileStarlingApplication1, Configuration: Debug Android ------
------ Deploy started: Project: MobileStarlingApplication1, Configuration: Debug Android ------
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

The problem comes when you get non-informative Adobe error messages like 'exit code 9' wich tells you nothing. The way to find out what is going on is to increase the build diagnostic level. Go to Tools | Options |Projects | Build and Run and set MSBuild project build output verbosity to Normal. You will now get something like this:
Code:
------ Build started: Project: MobileStarlingApplication1, Configuration: Debug Android ------
Target "Initialize" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Output path is "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\"
Target "ProcessReferences" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Target "BuildAIR" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Building AIR SWF for src\MobileStarlingApplication1_Android.as
Copying file from "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\config\MobileStarlingApplication1_Android-app.xml" to "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android-app.xml".
"C:\Flex SDKs\flex_sdk_4.6.0.23201B\bin\mxmlc.exe" -load-config+="C:\Users\dermot\AppData\Local\SapphireSteel Software\Amethyst_2_12.0\Temp\xahahn2p\MobileStarlingApplication1_Android.xml" -swf-version=15 -output "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.swf" -- "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\src\MobileStarlingApplication1_Android.as"
Loading configuration file C:\Flex SDKs\flex_sdk_4.6.0.23201B\frameworks\flex-config.xml
Loading configuration file C:\Users\dermot\AppData\Local\SapphireSteel Software\Amethyst_2_12.0\Temp\xahahn2p\MobileStarlingApplication1_Android.xml
C:\Users\dermot\Documents\Visual Studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.swf (102608 bytes)
Copied content 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\config\MobileStarlingApplication1-app.xml' to 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\config\MobileStarlingApplication1-app.xml'
Copied content 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\config\MobileStarlingApplication1_Android-app.xml' to 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\config\MobileStarlingApplication1_Android-app.xml'
Copied content 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\config\MobileStarlingApplication1_iOS-app.xml' to 'c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\config\MobileStarlingApplication1_iOS-app.xml'
MXML Compiler succeeded
Target "Build" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (entry point):
Target "Initialize" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Output path is "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\"
Target "ProcessReferences" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Target "BuildAIR" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Skipping target "BuildAIR" because all output files are up-to-date with respect to the input files.
Target "Build" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (entry point):
------ Deploy started: Project: MobileStarlingApplication1, Configuration: Debug Android ------
Target "Initialize" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Output path is "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\"
Target "ProcessReferences" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Target "BuildAIR" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Build" depends on it):
Skipping target "BuildAIR" because all output files are up-to-date with respect to the input files.
Target "Build" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Deploy" depends on it):
Target "DeployAIR" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (target "Deploy" depends on it):
Deploying c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.apk
"C:\Flex SDKs\flex_sdk_4.6.0.23201B\bin\adt.bat" -package -target apk-debug -listen 7936 -storetype pkcs12 -keystore "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\a.b.p12" -storepass zzz "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.apk" "MobileStarlingApplication1_Android-app.xml" "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.swf"
NOTE: The AIR SDK no longer supports packaging Android applications for use with the shared runtime. The application has been packaged with a captive runtime.
"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" start-server
"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -d install -r "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.apk"
pkg: /data/local/tmp/MobileStarlingApplication1_Android.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
2575 KB/s (10163192 bytes in 3.853s)
Deploy succeeded
Target "Deploy" in file "C:\Program Files (x86)\MSBuild\SapphireSteel Software\Amethyst_2_12.0\Amethyst.targets" from project "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\MobileStarlingApplication1.amproj" (entry point):
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========
In this case, I don't know what the INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES means or why it came back with success - I'll have to look at that. But the point is you do get more info and you can cut and paste the commands and run them in a command window which allows you to track down what's going on. So typically, I will now copy this command line
Code:
"C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" -d install -r "c:\users\dermot\documents\visual studio 2013\Projects\MobileStarlingApplication1\MobileStarlingApplication1\bin\Debug\MobileStarlingApplication1_Android.apk"
pkg: /data/local/tmp/MobileStarlingApplication1_Android.apk
and paste it into a command prompt.

The key store generation works ok for me, so I suspect it might be an sdk issue.

Dermot
Logged
idleBishop
Newbie
*
Posts: 10


« Reply #4 on: August 15, 2014, 12:33:16 PM »

Awesome, thanks for all the details. I'll give those a shot ASAP.
Logged
idleBishop
Newbie
*
Posts: 10


« Reply #5 on: August 19, 2014, 12:41:22 AM »

Ok, Making progress. Some updates:

> Air namespace issue

Part of my problem was the version of Flex 4.6.0 I had required 3.4, not 3.7, so that discrepancy was my fault. I applied AIR 14 to Flex 4.6.0 and the Android certificate tool works now. I don't know why it would have broken in Apache Flex though, but it appears it has.

I can now update my App descriptor xml file to version 4.0, but for some reason no further. The AIR sdk is definitely 14, so I'm not sure what's going on there. I'll follow up if/when that becomes a problem.

> project templates

I am utilizing stage3d in my project, and noticed I needed to add the <renderMode>direct</renderMode> tag to the app xml. I know this isn't a default setting for projects, but it would be handy to at least include it in the template but commented out or something. Sometimes it's easy to forget which of those required tags are necessary if they're not there.

> Log verbosity

my settings appeared to already be set to "Normal", but I set them to "Detailed" just in case.

> Library project setup

Thanks for pointing out that I needed a new project for that, somehow I missed that part of the tutorial, and the "Flex 4" library name was a bit misleading since I don't actually want any Flex in my external libraries, but everything seems to work as expected now! Here's the specific tutorial link in case anyone else is skimming this thread: https://www.youtube.com/watch?v=Cu_Va49DECs

> An unrelated observation

I noticed that when I try to utilize the code completion feature, code is often completed incorrectly. For example, if I type:

StageScaleMode.NO_

and press ctrl+space to invoke the completion window, I see StageScaleMode.NO_SCALE, which I select, and then I get:

StageScaleMode.NO_NO_SCALE instead of StageScaleMode.NO_SCALE. Is there a more correct way to invoke the code completion option?
Logged
idleBishop
Newbie
*
Posts: 10


« Reply #6 on: August 19, 2014, 01:01:13 AM »

A relevant note for anyone that comes across this thread: The Project|Add Reference option also works (and is necessary) for library projects that depend on other library projects. For example, I'm using the Starling library source code + the Feathers library source code, which depends on Starling... so a reference needed to be added to the Feathers library project. That took me a minute to figure out.
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1068


« Reply #7 on: August 21, 2014, 02:47:22 AM »

Hi

Thanks for the feedback.

The IntelliSense thing looks like a bug. We had a report of something like this a way back and I thought we had fixed it, but it looks like we haven't. We''ll do some more investigation.

The library project business works in a VB/C# manner. That is, it is the standard way .NET projects work in Visual Studio. It's somewhat different from the Eclipse way of working that is standard with FB.

I think the idea of putting more info in the templates but commenting it out is a good one. It would be a good idea, for example, to put instructions on the namespace problem in comments in the descriptor app. That's what Adobe does in the compiler configuration files. It cost nothing to do since everything is commented out and it puts the troubleshooting info in the correct place.

Dermot
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!