简体   繁体   English

Android Studio 2.1.1应用花费太多时间来启动应用

[英]Android studio 2.1.1 app taking too much time to launch app

hi i have updated android studio to 2.1.1 now my app is taking too much time to load all-most 10-15 sec extra. 嗨,我已经将android studio更新为2.1.1,现在我的应用花费了太多时间来额外加载10-15秒。 but same code was working properly in old version .. 但相同的代码在旧版本中正常工作..

is any way i can revert my android studio 有什么办法可以恢复我的android studio

does any one facing this issue ? 有人面对这个问题吗?

my luncher activity code : 我的午餐活动代码:

new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {

                Intent i = new Intent(this, hActivity.class);
                startActivity(i);
            }
        }          
    }, 2000);

Not sure about how to revert your android studio version, But in case that you didn't do this: 不知道如何还原您的android studio版本,但是如果您没有这样做:

Go to settings and check the offline mode option in gradle section. 转到设置并检查gradle部分中的离线模式选项。

This should make your app build and run faster because of skipping internet connections for gradle build every time you run your code. 这将使您的应用程序构建和运行速度更快,因为每次运行代码时都会跳过Internet连接以进行Gradle构建。

Try to deactivate Instant Run : 尝试停用Instant Run

Preferences → Build, Execution, Deployment → Instant Run and uncheck Enable Instant Run. 首选项→构建,执行,部署→即时运行,然后取消选中启用即时运行。

Update: 更新:

You can try also downgrading Gradle version in your project Build.gradle from: 您还可以尝试在项目Build.gradle Gradle版本降级为:

classpath 'com.android.tools.build:gradle:2.1.0' to classpath 'com.android.tools.build:gradle:2.1.0'

classpath 'com.android.tools.build:gradle:1.5.1'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM