tag:support.gradlefx.org,2011-05-23:/discussions/questions/58-air-dependency-problemGradleFx: Discussion 2014-08-11T06:47:22Ztag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T08:03:14Z2013-05-16T08:03:15ZAIR dependency problem<div><p>I followed the example to do this</p>
<p>...</p>
<p>add(new org.apache.ivy.plugins.resolver.URLResolver()) {<br>
name = 'Adobe Air SDK' addArtifactPattern '<a href=
"http://download.macromedia.com/air/win/download/[revision]/[module].[ext]&#39">http://download.macromedia.com/air/win/download/[revision]/[module]...</a>;
}</p>
<p>...</p>
<p>dependencies {<br>
merged project(':common') merged project(':game') airSDK group:
'com.adobe', name: 'AdobeAIRSDK', version: '3.7', ext: 'zip' }
...</p>
<p>it returns</p>
<ul>
<li>What went wrong: null</li>
</ul>
<p>I dont know how to fix the error</p>
<p>--stacktrace</p>
<ul>
<li>Exception is:
org.gradle.listener.ListenerNotificationException: Failed to notify
project eval<br>
uation listener.<br>
at
org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java
:90) at
org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java
:30) at
org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocat
ionHandler.invoke(ProxyDispatchAdapter.java:93)<br>
at com.sun.proxy.$Proxy8.afterEvaluate(Unknown Source) at
org.gradle.configuration.LifecycleProjectEvaluator.evaluate(Lifecycle
ProjectEvaluator.java:48)<br>
at
org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:464)<br>
at
org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProj
ect.java:77)<br>
at
org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.exec
ute(DefaultBuildConfigurer.java:38)<br>
at
org.gradle.configuration.DefaultBuildConfigurer$ConfigureProject.exec
ute(DefaultBuildConfigurer.java:36)<br>
at
org.gradle.api.internal.project.AbstractProject.configure(AbstractPro
ject.java:440)<br>
at
org.gradle.api.internal.project.AbstractProject.allprojects(AbstractP
roject.java:435)<br>
at
org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuil
dConfigurer.java:32)<br>
at
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
GradleLauncher.java:142)<br>
at
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
Launcher.java:113)<br>
at
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
cher.java:81)<br>
at
org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.jav
a:38)<br>
at
org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execut
e(InProcessGradleLauncherActionExecuter.java:39)<br>
at
org.gradle.launcher.exec.InProcessGradleLauncherActionExecuter.execut
e(InProcessGradleLauncherActionExecuter.java:25)<br>
at
org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at
org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions
.java:171) at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:201)<br>
at
org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
execute(CommandLineActionFactory.java:174)<br>
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:170)<br>
at
org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
CommandLineActionFactory.java:139)<br>
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:33)<br>
at
org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
ortingAction.java:22)<br>
at org.gradle.launcher.Main.doAction(Main.java:48) at
org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at
org.gradle.launcher.Main.main(Main.java:39) at
org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
trap.java:50)<br>
at
org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
ava:32)<br>
at org.gradle.launcher.GradleMain.main(GradleMain.java:26) Caused
by: java.lang.NullPointerException<br>
at
org.gradlefx.configuration.sdk.SdkInstallLocationFactory.createSdkLoc
ation(SdkInstallLocationFactory.groovy:64)<br>
at
org.gradlefx.configuration.sdk.SdkInstallLocationFactory$createSdkLoc
ation.call(Unknown Source)<br>
at
org.gradlefx.configuration.sdk.states.AbstractCreateSdkInstallLocatio
nState.process(AbstractCreateSdkInstallLocationState.groovy:39)<br>
at
org.gradlefx.configuration.sdk.states.air.CreateAirSdkInstallLocation
State.super$2$process(CreateAirSdkInstallLocationState.groovy)<br>
at
org.gradlefx.configuration.sdk.states.air.CreateAirSdkInstallLocation
State.process(CreateAirSdkInstallLocationState.groovy:40)<br>
at org.gradlefx.configuration.sdk.SdkInitState$process.call(Unknown
Sour ce)<br>
at org.gradlefx.configuration.sdk.SdkInitState$process.call(Unknown
Sour ce)<br>
at
org.gradlefx.configuration.sdk.DefaultSdkInitialisationContext.initSd
k(DefaultSdkInitialisationContext.groovy:33)<br>
at
org.gradlefx.configuration.sdk.SdkInitialisationContext$initSdk.call(
Unknown Source)<br>
at
org.gradlefx.plugins.GradleFxPlugin.initializeSDKs(GradleFxPlugin.gro
ovy:70)<br>
at
org.gradlefx.plugins.GradleFxPlugin.configure(GradleFxPlugin.groovy:5
2)<br>
at
org.gradlefx.plugins.AbstractGradleFxPlugin$_apply_closure1.doCall(Ab
stractGradleFxPlugin.groovy:49)<br>
at
org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(Cl
osureBackedMethodInvocationDispatch.java:40)<br>
at
org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(Cl
osureBackedMethodInvocationDispatch.java:25)<br>
at
org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java
:81) ... 31 more</li>
</ul>
<p>BUILD FAILED</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T08:21:20Z2013-05-16T08:21:20ZAIR dependency problem<div><p>You also have to specify the flexSDK dependency. You can do this
the same way as you defined the AIR SDK dependency or you can use a
local flex installation by referencing it with the flexHome
convention property.</p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T09:24:46Z2013-05-16T09:53:51ZAIR dependency problem<div><p>I tried to use local air. it still returns null</p>
<p>Here is the change</p>
<p>airSDK files('C:/AdobeAIRSDK.zip')</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T10:41:32Z2013-05-16T10:41:32ZAIR dependency problem<div><p>I think you misunderstood my answer :)<br>
Only specifying the AIR SDK isn't enough, you also have to specify
the Flex SDK, like this:</p>
<pre>
<code>repositories {
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'Apache'
addArtifactPattern 'http://apache.cu.be/flex/4.9.0/binaries/[module]-[revision]-bin.[ext]'
}
...air sdk repository
}
dependencies {
flexSDK group: 'org.apache', name: 'apache-flex-sdk', version: '4.9.0', ext: 'tar.gz'
airSDK group: 'com.adobe', name: 'AdobeAIRSDK', version: '3.7', ext: 'zip'
}</code>
</pre>
<p>Look here for a full example: <a href=
"https://github.com/GradleFx/GradleFx-Examples/blob/master/sdk-autoinstall/build.gradle">
https://github.com/GradleFx/GradleFx-Examples/blob/master/sdk-autoi...</a></p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T17:14:19Z2013-05-16T17:15:10ZAIR dependency problem<div><p>Thanks for your reply. I got this error</p>
<p>Error: Access of possibly undefined property HIGH_16X16_LINEAR
through a reference with static type Class.</p>
<p>this.stage.quality = StageQuality.HIGH_16X16_LINEAR;<br>
^</p>
<p>as my project is only depend on air (no flex). This is the
reason that I just include the airSDK(I can build in Flash
Builder)</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-16T19:22:54Z2013-05-16T19:22:54ZAIR dependency problem<div><p>So I guess you have an actionscript only project? Thing is that
the Flex SDK contains the compiler, without it GradleFx has nothing
to compile your application with.</p>
<p>In case you have an actionscript only project, you can set the
frameworkLinkage property to 'none' so that the compiler doesn't
link the Flex framework libraries (since you don't need them):</p>
<pre>
<code> frameworkLinkage = 'none'</code>
</pre>
<p>To fix your error, can you try add the following:</p>
<pre>
<code>additionalCompilerOptions = [
"-swf-version=16"
]</code>
</pre>
<p>I think the constant that you're trying to use is new since
FlashPlayer 11.3, and to use it you have to specify that compiler
argument. For more info see <a href=
"http://helpx.adobe.com/flash-player/release-note/developer-release-notes-11_3.html">
http://helpx.adobe.com/flash-player/release-note/developer-release-...</a></p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-17T03:30:35Z2013-05-17T03:30:35ZAIR dependency problem<div><p>Mine is actionscript only project. I followed your instruction
and it shows the same error. Thanks for your help</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-17T07:54:31Z2013-05-17T07:54:31ZAIR dependency problem<div><p>Can you try these two combinations and let me know the
result:</p>
<ol>
<li>use GradleFx 0.6.4 and remove the frameworkLinkage property
(use the default)<br></li>
<li>use GradleFx 0.6.3 with the frameworkLinkage property set to
'none'</li>
</ol></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-17T15:08:18Z2013-05-17T15:08:18ZAIR dependency problem<div><p>1 and 2 show the same error</p>
<p>Background information:<br>
I have 3 projects<br>
common (swc). it is using flex lib<br>
game (swc) depends on common. it is using flex lib<br>
web (swf) depends on game. it is using air lib</p>
<p>I can build game and common successfully. web can't</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-17T17:05:35Z2013-05-17T17:05:35ZAIR dependency problem<div><p>I tried building a test case, but couldn't reproduce the
problem. Can you try to build a small testcase which reproduces the
problem?</p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-18T03:59:06Z2013-05-18T03:59:06ZAIR dependency problem<div><p>Hey Trevels,</p>
<p>I uploaded my simple project with build.gradle. I tested that
and it is failed with the same error. Would you mind checking this
for me? Thank you very much!!</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-18T11:42:56Z2013-05-18T11:42:56ZAIR dependency problem<div><p>Hi guys,<br>
I think I see where the problem originates: I just ran that script
and while installing the Flex SDK + AIR I saw the following
line:</p>
<pre>
<code>player global url: http://fpdownload.macromedia.com/get/flashplayer/updaters/11/playerglobal11_1.swc</code>
</pre>
<p>Now in the docs it says <a href=
"http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageQuality.html#HIGH_16X16_LINEAR">
StageQuality.HIGH_16X16_LINEAR</a> requires at least Flash Player
11.3</p>
<p>I don't know how the installation process works, more precisely
where that playerglobal.swc version is defined (in GradleFx or
elsewhere), but at least you know where to start looking. Perhaps
you need AIR 3.8beta for that player version? Perhaps the only
solution is for Wood to manually configure his Flex SDK with the
right playerglobal.swc?</p>
<p>Cheers,<br>
Max</p>
<p>@Wood: btw Trevels is Yennick's last name ;)</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-18T21:31:02Z2013-05-18T21:31:02ZAIR dependency problem<div><p>AIR 3.5 should be sufficient.<br>
The flashplayer url is coming from this file: <a href=
"http://flex.apache.org/sdk-installer-config.xml">http://flex.apache.org/sdk-installer-config.xml</a><br>
It's the same file used by the Apache Flex Installer.<br>
Installing FlashPlayer 11.3 in the sdk could indeed be an option,
and then use this configuration:</p>
<pre>
<code>additionalCompilerOptions = [
"-target-player=11.3",
"-swf-version=16"
]</code>
</pre>
<p>Haven't tested this myself since I didn't have time yet. But
certainly worth a try.</p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-19T13:12:58Z2013-05-19T13:12:58ZAIR dependency problem<div><p>I guess it would be possible to add a dependency scope (e.g.
<code>player</code>) that can override the default that comes with
the Flex SDK. Or would that be too complicated?</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-19T16:19:52Z2013-05-19T16:19:52ZAIR dependency problem<div><p>Shouldn't be hard to do.</p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-20T07:38:59Z2013-05-20T07:38:59ZAIR dependency problem<div><p>After modifying the player version in flex-config.xml, I can
build the project successfully but the swf size is quite small. the
swf size from Flash Builder and gradle are about 8XXKB and 3XXKB
respectively. Gradle build is not runnable.<br>
Thanks</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-20T10:49:39Z2013-05-20T10:49:39ZAIR dependency problem<div><p>I think you can also change the player version by providing it
as an argument to the additionalCompilerOptions property (as shown
in one of my previous posts), that way you won't have to edit the
sdk.</p>
<p>Regarding the size of your swf, I don't know if you specified
the frameworkLinkage property as I said in the beginning of this
thread, but it can have something to do with it. When I said that I
didn't know that your game (swc) project depended on flexlib, which
probably needs the Flex SDK linked in.<br>
What you can do is remove the frameworkLinkage property and see if
it works.</p></div>Yennick Trevelstag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-20T12:53:39Z2013-05-20T12:53:39ZAIR dependency problem<div><p>If it has dependencies on the Flex framework and
<code>frameworkLinkage</code> is set to <code>none</code> it
shouldn't compile.</p>
<p>One other thing: I suspect you're trying to build a mobile app
(because of the usage of
<code>StageQuality.HIGH_16X16_LINEAR</code>), but the
<code>type</code> in the test script you provided is set to
<code>swf</code>, which is the type for building a regular web
app.<br>
When you say "Gradle build is not runnable", do you mean it's not
runnable in the standalone player, the browser, the AIR player or a
mobile device?</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-20T13:09:24Z2013-05-20T13:16:13ZAIR dependency problem<div><p>Wood, I just compiled your test project simply by adding the
line suggested by Yennick, except I changed the player version to
<code>11.7</code> since that seems to come with Flex 4.9.1 by
default.</p>
<pre>
<code>additionalCompilerOptions = [
"-target-player=11.7",
"-swf-version=16"
]</code>
</pre>
<p>It compiled just fine, but when I ran it, it failed at runtime.
The reason was that the variable
<code>StageQuality.HIGH_16X16_LINEAR</code> was
<code>undefined</code>. So I checked the version of my standalone
player, which was <code>11.1</code> which explains the error:
<code>StageQuality.HIGH_16X16_LINEAR</code> doesn't exist in that
version of the player.<br>
So I repeat my question: which player are you running your swf
with? And more specifically which version?</p>
<p>I then downloaded the FlashPlayer debugger 11.7 from <a href=
"http://www.adobe.com/support/flashplayer/downloads.html">http://www.adobe.com/support/flashplayer/downloads.html</a>
and used that: the compiled application runs as expected with this
player.</p></div>Maxime Coweztag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-27T16:03:45Z2013-05-27T16:03:45ZAIR dependency problem<div><p>I can build it and it is runnable.</p>
<p>But I still dont understand, there is a huge difference in the
swf size between flash builder and gradle even though the compiler
options are same.</p>
<p>Anyway, Thanks Maxime and Yennick!!!</p></div>woodtag:support.gradlefx.org,2011-05-23:Comment/268707502013-05-27T16:29:11Z2013-05-27T16:29:11ZAIR dependency problem<div><p>The reason that the swf generated by FlashBuilder is bigger can
be that FlashBuilder compiled it as a debuggable swf, while with
GradleFx it's a non-debuggable swf (so without all the debug
information). Just a guess though if this is the case for you.</p></div>Yennick Trevels