我在 FlashDevelop 中创建了一个 NME 项目,在 Main.hx 中我加载了一个位图,然后单击以 android 为目标的构建按钮。构建成功完成,但随后出现以下错误:
Running process: C:\Motion-Twin\haxe\haxelib.exe run nme run "C:\Users\...\...\flash-develop\haxe-nme-playground\NMEAndroidTest\application.nmml" android adb server is out of date. killing...
* daemon started successfully * pkg: /data/local/tmp/NMEAndroidTest-debug.apk
Failure [INSTALL_FAILED_CONTAINER_ERROR]
518 KB/s (1838507 bytes in 3.460s) Starting: Intent { act=android.intent.action.MAIN cmp=com.test.nme.android.NMEAndroidTest/.MainActivity }
Error type 3
Error: Activity class {com.test.nme.android.NMEAndroidTest/com.test.nme.android.NMEAndroidTest.MainActivity} does not exist.
但是 Activity 确实存在:
AndroidManifest.xml 的内容:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:versionCode="2" android:versionName="1.0.0" package="com.test.nme.android.NMEAndroidTest">
<application android:label="NMEAndroidTest" android:debuggable="true" android:icon="@drawable/icon">
<activity android:name="MainActivity" android:label="NMEAndroidTest" android:configChanges="keyboard|keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="ouya.intent.category.GAME"/>
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
NME 应该开箱即用地在 Android 上运行,我没有做任何可能破坏它的关键操作。