2

I'm giving Android Instant Run a test run. For testing, I just added the following line to the onResume() of my Activity:

Toast.makeText(this, "test123", Toast.LENGTH_SHORT).show();

Now, when I change the text of the toast and rebuild, it will tell me

"Instant Run detected that a resource referenced from the AndroidManifest.xml file has changed"

Can anyone explain what's going on here? I didn't change any resource, just the string literal in the Activity java file. ( I'm aware that I should use string resources in Android btw).

treesAreEverywhere
  • 3,722
  • 4
  • 28
  • 51

1 Answers1

4

Seems like the issue was that my build.gradle modifies the Android Manifest:

debug {
    ...
    def theVersionNameSuffix = "-debug-" + getCurrentDateTimeString();
    versionNameSuffix theVersionNameSuffix
    ...
}

Since the suffix is different in every build, that means that the versionName changes between builds which changes the AndroidManifest.

I have removed the versionNameSuffix entry and now it seems to work.

treesAreEverywhere
  • 3,722
  • 4
  • 28
  • 51
  • That was the issue we had as well. Our fix was to keep timestamp in one flavor and remove it from the other one (needed that from jRebel). ```debug { productFlavors.dev.versionNameSuffix "." + getTimestampText(); productFlavors.fast.versionNameSuffix ".fast"; ... } ``` – fada21 May 11 '17 at 11:38