3

We have recently uploaded the increased version of application on play store. Whenever we are trying to update application from playstroe, its crashing and throwing ResourceNotFound Exception as given below :

--------- beginning of system

 12-25 15:17:26.608 21693-21693/? E/AndroidRuntime: FATAL EXCEPTION: main
                                               Process: com.ultimatix.grs.application, PID: 21693
                                               android.content.res.Resources$NotFoundException: Drawable com.ultimatix.grs.application:string/availability_united_states_with_asterisk with resource ID #0x7f0600b9
                                               Caused by: android.content.res.Resources$NotFoundException: File <font color=#FF0000>* </font>Available to join TCS on from drawable resource ID #0x7f0600b9
                                                   at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:729)
                                                   at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:575)
                                                   at android.content.res.Resources.getDrawable(Resources.java:767)
                                                   at android.support.v7.widget.ResourcesWrapper.getDrawable(Unknown Source)
                                                   at android.content.Context.getDrawable(Context.java:525)
                                                   at android.support.v4.content.ContextCompatApi21.getDrawable(Unknown Source)
                                                   at android.support.v4.content.ContextCompat.getDrawable(Unknown Source)
                                                   at android.support.v7.widget.AppCompatDrawableManager.getDrawable(Unknown Source)
                                                   at android.support.v7.widget.AppCompatDrawableManager.getDrawable(Unknown Source)
                                                   at android.support.v7.widget.AppCompatImageHelper.setImageResource(Unknown Source)
                                                   at android.support.v7.widget.AppCompatImageView.setImageResource(Unknown Source)
                                                   at com.tcs.grs.grsnavdrawer.a.a.a(Unknown Source)
                                                   at com.tcs.grs.grsnavdrawer.a.a.onBindViewHolder(Unknown Source)
                                                   at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(Unknown Source)
                                                   at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(Unknown Source)
                                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
                                                   at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(Unknown Source)
                                                   at android.support.v7.widget.LinearLayoutManager$LayoutState.next(Unknown Source)
                                                   at android.support.v7.widget.LinearLayoutManager.layoutChunk(Unknown Source)
                                                   at android.support.v7.widget.LinearLayoutManager.fill(Unknown Source)
                                                   at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(Unknown Source)
                                                   at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(Unknown Source)

But this resource is available. Secondly, if I am not updating the app instead directly downloading the new version, its working fine.

I banged my head to find out the root cause, didn't get the same. If anyone can suggest, would be really helpful. Note: This is unused resource in the project.

Here is @string.xml

  <string name="personal_detail_age_with_asterisk"><![CDATA[<font color=#FF0000>* </font><font color=#bdbdbe>Age</font>]]></string>
<string name="date_label_with_asterisk"><![CDATA[<font color=#FF0000>* </font><font color=#bdbdbe>Date</font>]]></string>
<string name="availability_united_states">Available to join TCS on</string>
<string name="availability_united_states_with_asterisk"><![CDATA[<font color=#FF0000>* </font>Available to join TCS on]]></string>
<string name="availability_united_states_disabled"><![CDATA[<font color=#FF0000>* </font><font color=#bdbdbe>Available to join TCS on</font>]]></string>
<string name="under_age_label_united_states">If you are under the age of 18 years, can you provide a work permit ?</string>
<string name="under_age_label_united_states_with_asterisk"><![CDATA[<font color=#FF0000>* </font>If you are under the age of 18 years, can you provide a work permit ?]]></string>
<string name="authorized_to_work_united_states">If an offer of employment is extended to you, will you be able to demonstrate that you are authorized to work in the U.S ?</string>
<string name="authorized_to_work_united_states_with_asterisk"><![CDATA[<font color=#FF0000>* </font>If an offer of employment is extended to you, will you be able to demonstrate that you are authorized to work in the U.S ?]]></string>
<string name="military_training_usa">List any military training or experience that you feel relevant to the position you are applying to</string>

Please find required gradle's lines

       minSdkVersion 17
       targetSdkVersion 23
        versionCode 3
       versionName "1.2"
       multiDexEnabled = true
    }
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
}
buildTypes {
    release {
        minifyEnabled true
        debuggable false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
    debug {
        minifyEnabled false
        debuggable true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config1
    }
}
M.M.
  • 45
  • 5
  • This could be because resource shrinking and/or obfuscation. Can we see your build.gradle script especially for the release and debug build type? Do you use ProGuard? – anthonymonori Jan 03 '18 at 10:10
  • @anthonymonori, Yes I am using proguard. I have updated the question with build.gradle' s required scripts. – M.M. Jan 03 '18 at 10:36
  • Is this behaviour consistent on multiple API levels or is it specific to a version? – anthonymonori Jan 03 '18 at 10:41
  • I have verified this on 7.0 till now. – M.M. Jan 03 '18 at 11:07
  • Something seems to be off; can't see why it is complaining about a drawable when you are pointing to a string resource. Could you share the layout and the Activity code for it? We should be able to spot it that way. – anthonymonori Jan 03 '18 at 11:34
  • this string is not being used any where in the code....@ anthonymonori – M.M. Jan 04 '18 at 04:48

1 Answers1

2

This sounds extremely strange. Can you check that the APKs you get by updating and by installing the new version fresh are the same?

You can pull the APK off the device as described in this stackoverflow answer.

If the two APKs are the same, then this is really weird. If the two APKs are different that suggests there is a bug in the Google Play store, and you should contact Google Play Developer support via the Google Play console. They will take this very seriously and escalate to the appropriate people.

Nick Fortescue
  • 13,530
  • 1
  • 31
  • 37
  • Thanks for your suggestion, I will do the same.. will post it here. – M.M. Jan 05 '18 at 12:19
  • But what needs to be checked in two APKs, in order to see differences/similarities? @Nick Fortescue – M.M. Jan 05 '18 at 12:26
  • Just do a pure byte difference, eg using "diff" on unix or "fc" (file compare) on Windows. The fies from an update and a fresh install should be byte for byte identical. – Nick Fortescue Jan 05 '18 at 14:34
  • In order to compare two apks, I have used "fc" command. Its giving "no differences encountered". Is there something to do with google play store team involvement for the same issue? – M.M. Jan 08 '18 at 08:09
  • Is there something to do with sharedpref clearance during app up-gradation? – M.M. Jan 08 '18 at 08:34
  • I tried by removing all unused strings, still getting getting exception now for one used string in project. One more thing, both apks have been built with different version of Android studios.Please suggest. – M.M. Jan 11 '18 at 05:48