开始下载android studio,828M
win7系统下载jdk jdk-7u71-windows-i586 1.7.0
更新
Android SDK was installed to e:\Android\sdk
Refresh Sources:
Fetched Add-ons List successfully
Refresh Sources
Installing Archives:
Preparing to install archives
Installing Android SDK Tools, revision 24.0.2
Installed Android SDK Tools, revision 24.0.2
Done. 1 package installed.
Android SDK is up to date.
Creating Android virtual device
Android virtual device Nexus_5_API_21_x86 was successfully created
新建项目的时候报错:unable to start the daemon process
Error:Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
解决办法
1 定位到目录 C:\Users\<username>\.gradle
2 新建文档gradle.properties创建一个文本文档gradle.txt,将文件后缀名改.properties 就行了
内容:org.gradle.jvmargs=-Xmx512m
3 重启你的Android Studio项目,搞定。
问题:怎么用android studio开发项目
7:55 2014/12/24
用模拟器运行新建的经典工程Helloworld时出现错误
e:\Android\sdk\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
supported portrait竖屏
landscape 横屏
13:27 2014/12/24
模拟器用不了,下载新的模拟器好麻烦,还是用真机调试得了,还好有原来的摩托罗拉手机在。
22:59 2014/12/24
新建一个项目后用小米2S调试,效果不错!
下面是logcat
12-24 22:57:37.496 12345-12345/net.idundun.test1 E/dalvikvm﹕ native fork pid:0 done.
12-24 22:57:37.496 12345-12356/net.idundun.test1 E/dalvikvm﹕ threadid=6: created from interp,name=ReferenceQueueDaemon
12-24 22:57:37.496 12345-12356/net.idundun.test1 E/dalvikvm﹕ threadid=6: calling run(),name=ReferenceQueueDaemon
12-24 22:57:37.496 12345-12357/net.idundun.test1 E/dalvikvm﹕ threadid=7: created from interp,name=FinalizerDaemon
12-24 22:57:37.496 12345-12357/net.idundun.test1 E/dalvikvm﹕ threadid=7: calling run(),name=FinalizerDaemon
12-24 22:57:37.496 12345-12358/net.idundun.test1 E/dalvikvm﹕ threadid=8: created from interp,name=FinalizerWatchdogDaemon
12-24 22:57:37.496 12345-12358/net.idundun.test1 E/dalvikvm﹕ threadid=8: calling run(),name=FinalizerWatchdogDaemon
12-24 22:57:37.536 12345-12345/net.idundun.test1 D/ActivityThread﹕ setTargetHeapUtilization:0.25
12-24 22:57:37.536 12345-12345/net.idundun.test1 D/ActivityThread﹕ setTargetHeapIdealFree:8388608
12-24 22:57:37.536 12345-12345/net.idundun.test1 D/ActivityThread﹕ setTargetHeapConcurrentStart:2097152
12-24 22:57:37.696 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 11345: Landroid/view/ViewGroup;.onNestedScrollAccepted (Landroid/view/View;Landroid/view/View;I)V
12-24 22:57:37.696 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 11351: Landroid/view/ViewGroup;.onStopNestedScroll (Landroid/view/View;)V
12-24 22:57:37.696 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 9039: Landroid/support/v7/internal/widget/ActionBarOverlayLayout;.stopNestedScroll ()V
12-24 22:57:37.716 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 11348: Landroid/view/ViewGroup;.onRtlPropertiesChanged (I)V
12-24 22:57:37.716 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 364: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
12-24 22:57:37.716 12345-12345/net.idundun.test1 W/dalvikvm﹕ VFY: unable to resolve virtual method 386: Landroid/content/res/TypedArray;.getType (I)I
12-24 22:57:37.796 12345-12345/net.idundun.test1 I/Adreno200-EGL﹕ <qeglDrvAPI_eglInitialize:294>: EGL 1.4 QUALCOMM build: (CL3090659)
Build Date: 09/03/13 Tue
Local Branch:
Remote Branch:
Local Patches:
Reconstruct Branch:
一个好的网站:http://stormzhang.com/devtools/2014/12/18/android-studio-tutorial4/
这个文件是app文件夹下这个Module的gradle配置文件,也可以算是整个项目最主要的gradle配置文件,我们来看下这个文件的内容:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "net.idundun.test1"
minSdkVersion 8
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}