我正在尝试运行我的第一个 android hello world program ,我已经设置了 Android SDK 并安装了所需的软件包,然后使用 AVD Manager ,然后在 netbeans7.4 中配置 android 和 sdk 。我在netbeans中使用常规配置创建了一个新的常规 android项目:
然后尝试在我使用 AVD 创建的设备上运行它,但只得到了结果:
,这是调试结果
ant -f C:\\Users\\HP\\Documents\\NetBeansProjects\\haha debug
Android SDK Tools Revision 22.3.0
Installed at D:\Solace Android\Solace Data\adt-bundle-windows-x86_64-20130729\sdk
Project Name: haha
Project Type: Application
Using latest Build Tools: 19.0.0
Resolving Build Target for haha...
Project Target: Android 4.4
API level: 19
WARNING: No minSdkVersion value set. Application will install on all Android versions.
----------
Creating output directories if needed...
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\res
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\rsObj
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\rsLibs
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\gen
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\classes
Created dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\dexedLibs
----------
Resolving Dependencies for haha...
Library dependencies:
No Libraries
------------------
----------
Building Libraries with 'debug'...
No sub-builds to iterate on
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
Handling aidl files...
No AIDL files to compile.
----------
Handling RenderScript files...
----------
Handling Resources...
Generating resource IDs...
----------
Handling BuildConfig class...
Generating BuildConfig class.
Compiling 3 source files to C:\Users\HP\Documents\NetBeansProjects\haha\bin\classes
input: C:\Users\HP\Documents\NetBeansProjects\haha\bin\classes
Converting compiled files and external libraries into C:\Users\HP\Documents\NetBeansProjects\haha\bin\classes.dex...
Crunching PNG Files in source dir: C:\Users\HP\Documents\NetBeansProjects\haha\res
To destination dir: C:\Users\HP\Documents\NetBeansProjects\haha\bin\res
Processing image to cache: C:\Users\HP\Documents\NetBeansProjects\haha\res\drawable-hdpi\ic_launcher.png => C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-hdpi\ic_launcher.png
(processed image to cache entry C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-hdpi\ic_launcher.png: 87% size of source)
Processing image to cache: C:\Users\HP\Documents\NetBeansProjects\haha\res\drawable-ldpi\ic_launcher.png => C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-ldpi\ic_launcher.png
(processed image to cache entry C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-ldpi\ic_launcher.png: 0% size of source)
Processing image to cache: C:\Users\HP\Documents\NetBeansProjects\haha\res\drawable-mdpi\ic_launcher.png => C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-mdpi\ic_launcher.png
(processed image to cache entry C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-mdpi\ic_launcher.png: 78% size of source)
Processing image to cache: C:\Users\HP\Documents\NetBeansProjects\haha\res\drawable-xhdpi\ic_launcher.png => C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-xhdpi\ic_launcher.png
(processed image to cache entry C:\Users\HP\Documents\NetBeansProjects\haha\bin\res\drawable-xhdpi\ic_launcher.png: 85% size of source)
Crunched 4 PNG files to update cache
Creating full resource package...
Current build type is different than previous build: forced apkbuilder run.
Creating haha-debug-unaligned.apk and signing it with a debug key...
Running zip align on final apk...
Debug Package: C:\Users\HP\Documents\NetBeansProjects\haha\bin\haha-debug.apk
Creating new property file: C:\Users\HP\Documents\NetBeansProjects\haha\bin\build.prop
Updating property file: C:\Users\HP\Documents\NetBeansProjects\haha\bin\build.prop
Updating property file: C:\Users\HP\Documents\NetBeansProjects\haha\bin\build.prop
Updating property file: C:\Users\HP\Documents\NetBeansProjects\haha\bin\build.prop
debug:
BUILD SUCCESSFUL (total time: 12 seconds)
答案 0 :(得分:1)
检查您的计算机规格。 AVD非常慢而且很重,因此启动Android需要花费大量时间(运行Linux的i7 3610qm和8GB ram需要3分钟才能启动,一旦启动它就会非常滞后)。
尝试使用BlueStacks运行Android,它是像AVD这样的Android虚拟设备,但IMO效果更好,速度更快。