"错误402:当前的Andr​​oid SDK版本不支持initialWindow为XML标签"尽管SDK 23 [英] "error 402: Current Android sdk version doesn't support initialWindow as xml tag" despite SDK 23

查看:287
本文介绍了"错误402:当前的Andr​​oid SDK版本不支持initialWindow为XML标签"尽管SDK 23的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个旧的Adobe AIR应用程序,是工作就好了Android上,但它出来,在肖像模式。在不改变源代码,只是应用程序描述,我想解决这个问题。目前,我有:

I have an old Adobe AIR app that is working just fine on Android, except that it comes out in portrait mode. Without changing the source, just the application descriptor, I would like to fix this. Currently I have:

<application xmlns="http://ns.adobe.com/air/application/2.6">
...
<android>
   <manifestAdditions>
      <![CDATA[
          <manifest android:installLocation="preferExternal">
              <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
              <supports-screens android:normalScreens="true"/>
              <application android:enabled="true">
...

现在,如果我补充一点:

Now, if I add this:

                  <initialWindow>
                    <aspectRatio>landscape</aspectRatio>
                  </initialWindow>

...内内&lt;应用&GT; 标签,ADT说:

application.xml: error 402: Current Android sdk version doesn't support initialWindow as xml tag

我试着改变空气的版本(是的,请参阅AIR和Android手机,下同)达3.9没有区别。

I tried changing the AIR version (yes, see AIR vs Android below) up to 3.9 with no difference.

如果我把它内只有外&lt;应用&GT; 我得到这个错误,而不是:

If I put it within only the outer <application> I get this error instead:

application.xml(24): error 103: application.initialWindow is an unexpected element/attribute

所以我猜我有它在正确的位置,但我需要添加一个版本号。

So I'm guessing I have it in the right spot, but I need to add a version number.

然而,有些搜索后,我找不到任何地方记录它的Andr​​oid SDK版本,我需要指定(使用的的-platformsdk标志在ADT命令,如果元件的Andr​​oid 2.2之后推出的)。

However, after a bit of searching, I could not find documented anywhere which Android SDK version I would need to specify (using "the -platformsdk flag in the ADT command if the element was introduced after Android 2.2").

&LT; initialWindow&GT; 的东西其实不是一个Android XML标签,而是一个Adobe XML标签,违背<一个href="http://help.adobe.com/en_US/air/build/WSfffb011ac560372f2fea1812938a6e463-8000.html#WSfffb011ac560372f33105f2a1293d3d21e0-7ffe"相对=nofollow> Adob​​e的文档它说的子元素的&LT;舱单&GT; 标记的定义的是Android SDK (搜索&LT; initialWindow&GT; ,你会发现只有Adobe AIR的文档,而不是Android的SDK文档这是太糟糕,因为后者是pretty的擅长。告诉你到底是哪个版本的元素是在引进。)

This <initialWindow> thing isn't actually an Android XML tag, but an Adobe XML tag, contrary to Adobe's documentation which says that child elements of the <manifest> tag are "Defined by the Android SDK." (Search for <initialWindow> and you'll find only Adobe AIR docs, not Android SDK docs. Which is too bad, because the latter are pretty good at telling you exactly which version an element was introduced in.)

我添加了 -platformsdk 选项指向了Android SDK,然后抱怨缺少aadt.exe。每 http://stackoverflow.com/a/16831707 我在复制从23.0.1下积聚的工具。我仍然得到了同样的信息。我也试过在&LT加;显明&GT; 标记&LT;使用-SDK安卓的minSdkVersion =23机器人:targetSdkVersion =23/ &GT; ,还是一样的结果。

I added the -platformsdk option pointing to the Android SDK, which then complained about missing aadt.exe. Per http://stackoverflow.com/a/16831707 I copied in that from 23.0.1 under build-tools. I still get the same message. I also tried adding within the <manifest> tag <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23" />, still the same result.

使用 AAPT 从Android SDK中,我发现了AIR制作APK,尽管更新1上面一行,包含此:

Using aapt from the Android SDK, I found out that the AIR-made APK, despite the above line in Update 1, contains this:

E: uses-sdk (line=48)
  A: android:minSdkVersion(0x0101020c)=(type 0x10)0x9
  A: android:targetSdkVersion(0x01010270)=(type 0x10)0x13

更新3:与AIR SDK也是如此19

尽管与此不同:

Update 3: Also true with AIR SDK 19

Although with this difference:

  A: android:minSdkVersion(0x0101020c)=(type 0x10)0x17
  A: android:targetSdkVersion(0x01010270)=(type 0x10)0x17

有趣的是与SDK 19,屏幕方向现在也定义的:

Interestingly with SDK 19, the screen orientation is now also defined:

    A: android:screenOrientation(0x0101001e)=(type 0x10)0x2

当然,

...但我想0(横向),而不是0X2(用户)。

...but of course I want 0 (landscape), not 0x2 (user).

推荐答案

其实,initialWindow标签进入最外层的应用程序标记中,作为文档说。有一次,我曾经尝试这样做,得到一个错误,但我想这是有别的东西,我是想一个巧合。我可以证实这一点修复它在AIR 2.6,3.9,和19。

Actually, the initialWindow tag goes within the outermost application tag, as the docs say. At one point I had tried this and gotten an error, but I guess it was a coincidence with something else I was trying. I can confirm this fixes it on AIR 2.6, 3.9, and 19.

这篇关于&QUOT;错误402:当前的Andr​​oid SDK版本不支持initialWindow为XML标签&QUOT;尽管SDK 23的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆