android-instant-run

StrictMode disk read violation on empty activity's setContentView

99封情书 提交于 2020-02-27 22:31:16
问题 I've recently tried to use StrictMode but got a weird violation, so I tried setting up a new 'Empty Activity' project (in Android Studio ) and added an Application class as follows (as described in here): public class TestApplication extends Application { @Override public void onCreate() { setStrictMode(); super.onCreate(); } private void setStrictMode() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode

StrictMode disk read violation on empty activity's setContentView

大憨熊 提交于 2020-02-27 22:29:26
问题 I've recently tried to use StrictMode but got a weird violation, so I tried setting up a new 'Empty Activity' project (in Android Studio ) and added an Application class as follows (as described in here): public class TestApplication extends Application { @Override public void onCreate() { setStrictMode(); super.onCreate(); } private void setStrictMode() { if (BuildConfig.DEBUG) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectAll() .penaltyLog() .build()); StrictMode

Can't run app with Instant Run on Android Studio 3.0

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 04:17:34
问题 I've updated to Android Studio 3.0 and now I cannot run the app with Instant Run enabled . I get 'Execution failed for task' due to a java.io.FileNotFoundException because it can't find the apk under ../build/intermediates/instant-run-resources/resources-production/ Any idea how to overcome this so that I can run the project with Instant Run? I'm not sure where to find the missing apk file or how to change the path to look for it in. 回答1: Have your settings as below, Otherwise try to clean

Android Images are not displayed after release build or if i instant run turn off

懵懂的女人 提交于 2019-12-24 07:16:10
问题 I am getting images id from drawable-hdpi at run time using getIdentifier method using following code mContext.getResources().getIdentifier(mContext.getPackageName() + ":drawable/" + mCur.getString(mCur.getColumnIndex(Constant.COLUMN_IMAGE_DRAWABLE)), null, null) i also tried following ways mContext.getResources().getIdentifier(mCur.getString(mCur.getColumnIndex(Constant.COLUMN_IMAGE_DRAWABLE))+"", "drawable", mContext.getPackageName()); and set image resource using following code imgPosotion

Android Instant Run First-time takes too much time to launch app after installed

自作多情 提交于 2019-12-20 08:59:42
问题 I have installed android-instant-run introduced in android-studio-2.0 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. 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 回答1: Hello I am also facing this issue when i update my Android Studio 2.0 This issue is resolved by

instant run java.lang.OutOfMemoryError: GC overhead limit exceeded

雨燕双飞 提交于 2019-12-17 23:34:41
问题 I have upgraded to Android Studio 2.1 and I got this error while I am trying to build & run my corporate big project: Execution failed for task ':app:transformClassesWithDexForMyAppDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded I have searched through the forum and disabled instant run, also write to my build.gradle: dexOptions {

How to share split APKs created while using instant-run, within Android itself?

寵の児 提交于 2019-12-17 22:22:19
问题 Background I have an app (here) that, among other features, allows to share APK files. In order to do so, it reaches the file by accessing the path of packageInfo.applicationInfo.sourceDir (docs link here), and just shares the file (using ContentProvider when needed, as I've used here). The problem This works fine in most cases, especially when installing APK files from either the Play Store or from a standalone APK file, but when I install an app using Android-Studio itself, I see multiple

no changes to deploy android studio 2.1

倖福魔咒の 提交于 2019-12-17 02:00:27
问题 Android Studio 2.1 instant run is not updating the app on the device I observed an issue with AndroidStudio 2.1. When I run the app with small java code changes, it doesn't update app on the device sometimes. Instead it shows a message No changes to deploy // (Don't show again) Am I missing any thing here? As a work around I do clean build every time in order to reflect the changes in app. 回答1: Upgrade Android studio version to 3 or more. this bug is resolved. This was a bug on version 2.0

Apply Changes Button Grayed out: Android Studio

…衆ロ難τιáo~ 提交于 2019-12-10 17:09:22
问题 I have set up my project's minSdkVersion as 15 and enabled Instant Run . I have deployed the app in my device running on API 21 But the "Apply Changes" button is grayed out.When I hover over the button it says "No Active 'App' launch" although I am running the app in my device at that time . 回答1: According to the guide, you also need to choose the debug build variant. To start using Instant Run, you also need to change the build variant to a debug version of your app and deploy it to a target

Android: App crashes frequently with instant run

老子叫甜甜 提交于 2019-12-10 13:13:16
问题 In my android app, I am debugging it with instant run enabled. The app gives me unexpected errors very frequently, which gets resolved if I did a clean build. For an example, there are sometimes class not found exceptions where the class is actually there. Also, sometimes there are class cast exceptions when trying to cast the View returned by findViewById() to the target type (probably android studio has misinterpreted the element IDs when hot deploying the layouts). All these errors get