Skip to main content
October 28, 2010
Resuelto

Creating an apk

  • October 28, 2010
  • 5 respuestas
  • 2712 visualizaciones

Hi, I'm new with Adobe Air and I got a problem with creating an apk. I use the xml and html files from the sdk tutorial (HelloWorld), yet I get an error when creating the apk:

HelloWorld-app.xml: error 304: Initial window content is invalid

What am I doing wrong?

I used the following command:

adt -package -target apk -storetype pkcs12 -keystore newselfcert.p12 HelloWorld.apk HelloWorld-app.xml HelloWorld.html

Her my xml file:

<?xml version="1.0" encoding="UTF-8"?>

<application xmlns="http://ns.adobe.com/air/application/2.5">

    <id>examples.html.HelloWorld</id>

    <versionNumber>0.1</versionNumber>

    <filename>HelloWorld</filename>

    <initialWindow>

        <content>HelloWorld.html</content>

        <visible>true</visible>

        <width>400</width>

        <height>200</height>

    </initialWindow>

</application>

Here my html file:

<!DOCTYPE HTML>

<html>

<head>

    <title>Hello World</title>

    <script type="text/javascript" src="AIRAliases.js"></script>

    <script type="text/javascript">

        function appLoad(){

            air.trace("Hello World");

        }

    </script>

</head>

<body onLoad="appLoad()">

    <h1>Hello World</h1>

</body>

</html>

Este tema ha sido cerrado para respuestas.
Mejor respuesta de Joe ... Ward

Unfortunately you cannot create an AIR for Android application using HTML/JavaScript. The root content must be a SWF file.

5 respuestas

Participant
February 18, 2013

I had the same problem, and I solved it changing the publish settings/compress mode to Deflate (LZMA mode does the error)

Participant
April 28, 2011

Holy crap ! got exactly the same issue

Is there any workaround ? a generic swf file loading an html file my app is full html ... is there the same limitation for iPhone app ?

The documentation said "The file referenced in the <content> element of the application descriptor is not recognized as a valid HTML or SWF file."

Participating Frequently
April 28, 2011

The same limitation is true for iOS. Using an HTML file as the root content is only supported on desktop platforms.

Note that if you don't use any AIR or Flash specific features, you could theoretically build an app using HTML/JavaScript and display it in a simple AIR SWF wrapper that loads the HTML in a StageWebView object. This is a bit off the beaten path, though, and debugging might be problematic.

Joe ... WardRespuesta
Participating Frequently
October 28, 2010

Unfortunately you cannot create an AIR for Android application using HTML/JavaScript. The root content must be a SWF file.

October 29, 2010

Ok, thank you for your response!