20

I have installed introduced in

I am getting problem while running my app first time. Its appearing with blank screen for a 5 to 10 seconds then after launching activity.

enter image description here

It takes time to run first time only for every application but why it happens that I don't know.

Logcat : W/System: ClassLoader referenced unknown path: /data/app/com.package.name/lib/arm

Vipul Asri
  • 7,856
  • 2
  • 41
  • 69
Pratik Butani
  • 51,868
  • 51
  • 228
  • 375

4 Answers4

3

Hello I am also facing this issue when i update my Android Studio 2.0

This issue is resolved by changing minSDKVersion from 14 to 16 and change the gradle version to 2.4. This will work fine.

patel135
  • 867
  • 13
  • 19
2

The question is already answered, but in my case, it is due to the strange issue with Android Studio 2.0 & 2.1. First time of launching application take longer than usual. This issue happens only in debug mode and not effect your released APK. Try creating a release build of your app and check. It should work perfectly.

nnn
  • 900
  • 6
  • 12
2

It's because with Instant Run enabled, Android Studio injecting some dex files to make Instant Run function run in target device. Because of it, your application will take longer times to run than it normally does.

To check it, look at your Android Studio monitor when it starting to run your application. It will show that some dex files been loading.

The benefit of Instant Run is when you change your application and run it, sometimes it will immediately run in your device target with short delay compared without Instant Run.

But the caveat is, Instant Run still buggy and it doesn't always work.

ישו אוהב אותך
  • 22,515
  • 9
  • 59
  • 80
0

Go to Gradle scripts -> build.gradle (Project). Inside the dependencies block, replace this line:

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

with this one,

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

Now, sync your project. After syncing your project, you will get some errors.

Go to gradle-wrapper.properties. Now replace this this line:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

with this one:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.2-all.zip

Sync your project once or twice and your problem should be solved.

  • ASFIK, to deploy android studio instant run, it is mandatory to have gradle version 2.0.0 or above. If we degraded the version we are disabling the "instant-run". Am I correct Partha Chakraborty? – Muhamed Riyas M May 04 '16 at 06:27
  • To disable instant run you don't need to downgrade the gradle version. You can do that in the perferences of Android Studio. Just search for "instant run" there and uncheck the feature. – Peter F Feb 23 '17 at 09:36