2016-07-03 2 views
0

나는 안드로이드 프로젝트를 가지고 있으며, 몇 주 전에 맥북에서 작업했습니다. 빌드는 Android Studio가 기기에 설치 한 후 즉시 시작되었습니다.Android Studio에서 빌드 Windows가 Android Studio에서 빌드보다 느리게 장치 시작 Mac OS

Android Studio와 JDK 8의 동일한 버전을 실행하는 새 Windows 노트북으로 이동 한 후 빌드가 훨씬 느리게 시작된다는 것을 알았습니다. AS가 앱을 설치하고 실행 한 후에 앱은 첫 번째 활동이 실행 된 후 평균 약 4 ~ 5 초 (최대 15-20 초) 동안 흰색 화면을 유지합니다.

비디오 : 맥 OS에

건물 : Windows에서 https://youtu.be/H55mfxOoBbM

건물 : https://youtu.be/-7FphwiMvs8

그것은 당신이 디버그 모드에서 실행 할 때 같은 느낌과 디버그 프로세스에 연결하는 것이 기다리고있다. 3 년 넘게 configs를 마이그레이션했기 때문에 Mac에서 Android Studio의 설정을 변경했는지 기억이 안납니다.

이 문제를 해결하려면 무엇을해야합니까?

EDIT : 내 생각 엔 윈도우가 bulid로 jit 컴파일러를 트리거하는 것입니다.

안드로이드 스튜디오 2.1.2

자바 1.8 U91

프로젝트 Gradle을 파일 :이 글의 첫번째 대답은 당으로

/* 
* Gets the version name from the latest Git tag 
*/ 

def getVersionName = { -> 
    def stdout = new ByteArrayOutputStream() 
    def command = 'git' 

    if (System.properties['os.name'].toLowerCase().contains('windows')) { 
     command = 'C:/Program Files/Git/cmd/git.exe' 
    } 

    exec { 
     commandLine command, 'describe', '--tags' 
     standardOutput = stdout 
    } 
    return stdout.toString().trim() 
} 

project.ext.versionPropsFile = file('version.properties') 

def getBuildNumber() { 
    def Properties versionProps = new Properties() 
    versionProps.load(new FileInputStream(project.versionPropsFile)) 
    def buildNumber = versionProps['artifactBuildNumber'].toInteger() + 1 
    versionProps['artifactBuildNumber'] = buildNumber.toString() 
    versionProps.store(versionPropsFile.newWriter(), null) 
    return buildNumber 
} 

def getReleaseVersionCode() { 
    def Properties versionProps = new Properties() 
    versionProps.load(new FileInputStream(project.versionPropsFile)) 
    def code = versionProps['artifactReleaseVersionCode'].toInteger() 
    return code 
} 

def getDevVersionCode() { 
    def Properties versionProps = new Properties() 
    versionProps.load(new FileInputStream(project.versionPropsFile)) 
    def code = versionProps['artifactDebugVersionCode'].toInteger() 
    return code 
} 

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 

android { 
    compileSdkVersion 24 
    buildToolsVersion "24.0.0" 

    defaultConfig { 
     applicationId "com.senic.nuimoapp" 
     minSdkVersion 18 
     targetSdkVersion 23 
     versionName getVersionName() 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
     debug { 
      applicationIdSuffix ".debug" 
      versionNameSuffix "-" + getBuildNumber() + "-DEBUG" 
     } 
    } 
    productFlavors { 
     dev { 
      versionCode getDevVersionCode() 
     } 
     prod { 
      versionCode getReleaseVersionCode() 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/beans.xml' 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:24.0.0' 
    compile 'com.android.support:design:24.0.0' 
    compile 'com.android.support:support-v4:24.0.0' 
    compile 'com.android.support:recyclerview-v7:24.0.0' 
    compile 'com.google.android.gms:play-services-appindexing:9.2.0' 
    // View binder 
    compile 'com.jakewharton:butterknife:7.0.1' 
    // DB and ORM 
    compile 'com.j256.ormlite:ormlite-core:4.48' 
    compile 'com.j256.ormlite:ormlite-android:4.48' 
    // Json parser 
    compile 'org.immutables:gson:2.1.14' 
    // Nuimo sdk 
    compile 'com.senic:nuimo-android:0.5.1' 
    compile 'org.jetbrains.kotlin:kotlin-stdlib:1.0.0' 
// compile project(':..:nuimo-android:nuimo') 
    // Bug tracker 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    testCompile 'junit:junit:4.12' 
    // LIFX Lan SDK 
    compile 'com.github.getsenic:lifx-sdk-android:[email protected]' 
    // Philips Hue SDK 
    compile files('libs/huelocalsdk.jar') 
    compile files('libs/huesdkresources.jar') 
    // OTA firmware update library 
    compile 'no.nordicsemi.android:dfu:0.6.3' 
    // Rest helper library 
    compile 'com.squareup.retrofit2:retrofit:2.1.0' 
    compile 'com.squareup.retrofit2:converter-gson:2.1.0' 
    // Upnp Library for Sonos or Raumfeld 
    compile files('libs/cling-core-2.1.0.jar') 
    compile files('libs/cling-support-2.1.0.jar') 
    compile files('libs/seamless-http-1.1.1.jar') 
    compile files('libs/seamless-util-1.1.1.jar') 
    compile files('libs/seamless-xml-1.1.1.jar') 
    compile 'org.eclipse.jetty:jetty-server:8.1.19.v20160209' 
    compile 'org.eclipse.jetty:jetty-client:8.1.19.v20160209' 
    compile 'org.eclipse.jetty:jetty-servlet:8.1.19.v20160209' 
    compile 'org.slf4j:slf4j-jdk14:1.7.20' 
    // Custom color picker (for Lifx and Philips Hue) 
    compile 'com.larswerkman:HoloColorPicker:1.5' 
} 
+0

다른 하드웨어에서 다른 플랫폼을 실행하고 있습니다. 몇 가지 잠재적 인 이유가 있습니다. 왜 어떤 복잡한 작업에는 다른 런타임 특성이 있습니다. – IInspectable

+0

디버그 빌드는 build.gradle 및 컴파일러의 설정에 따라 달라집니다. 빌드에 많은 영향을주는 것은 쉽게 판별 할 수 있어야합니다. 편집 : 디버그 빌드에 의해 나는 비 생산 빌드, 중단 점 디버깅하지 의미합니다. – Auras

+0

완전히 다른 하드웨어에서 실행되고 있습니다. 왜 당신은 하드웨어가 아무런 효과가 없어야한다고 주장합니까? – IInspectable

답변

0

:

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.2' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://jitpack.io" } 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

가 Gradle을 파일을 빌드 : https://code.google.com/p/android/issues/detail?id=215000#c1

범인은 ... 인스턴트 실행입니다. 사용 중지하고 이전과 마찬가지로 빠르게 사용할 수 있습니다.