android


App crashes while generating Signed apk with obfuscation (NoSuchMethodError)


I am facing with this peculiar problem where my app crashes as soon as it is launched when generating signed apk with obfuscation (progaurd).My progaurd looks like below :
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepattributes Exceptions,InnerClasses,Signature
-keep class com.google.api.client.**
-keepclassmembers class com.google.api.client.** {
*;
}
-keep class com.google.android.gms.**
-keepclassmembers class com.google.android.gms.** {
*;
}
-keep class com.google.gson.**
-keepclassmembers class com.google.gson.** {
*;
}
-keep class com.google.api.client.** { *; }
-dontwarn com.google.api.client.*
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.*
-dontnote org.apache.http.**
-dontwarn java.awt.**
-dontwarn org.postgresql.**
-dontwarn javax.activation.**
-dontnote javax.activation.**
-dontwarn myjava.awt.datatransfer.**
-dontnote myjava.awt.datatransfer.**
-dontwarn com.google.android.gms.**
-keep class com.google.android.gms.**
# The official support library.
-keep class android.support.v4.** { *; }
-keepclassmembers class android.support.v4.** {
*;
}
-keep interface android.support.v4.** { *; }
-keep class android.support.v7.** { *; }
-keepclassmembers class android.support.v7.** {
*;
}
-keep interface android.support.v7.** { *; }
-keep class org.apache.http.** { *; }
-keepclassmembers class org.apache.http.** {*;}
-dontwarn org.apache.**
-keep class org.codehaus.mojo.animal_sniffer.** { *; }
-keep class java.nio.file.** { *; }
-keep class java.lang.invoke.** { *; }
-keepclassmembers class com.fasterxml.jackson.core.**
-keepclassmembers class org.codehaus.mojo.animal_sniffer.**
-keepclassmembers class java.nio.file.**
-keepclassmembers class java.lang.invoke.**
-enter code here`-dontwarn retrofit2.**
-keep class retrofit2.** { *; }
-keepclasseswithmembers class * {
#retrofit2.http.* <methods>;
}
-keep class android.net.http.** { *; }
-keepclassmembers class android.net.http.** {*;}
-dontwarn android.net.**
I am able to generate the signed apk but if this app is launched ,the app crashes throwing the following error :
java.lang.NoSuchMethodError: No interface method i()I in class
Landroid/content/res/XmlResourceParser; or its super classes (declaration of
'android.content.res.XmlResourceParser' appears in
/system/framework/framework.jar)
at
android.support.v4.content.FileProvider.parsePathStrategy(Unknown Source)
at
android.support.v4.content.FileProvider.getPathStrategy(Unknown Source)
at
android.support.v4.content.FileProvider.attachInfo(Unknown Source)
at
android.app.ActivityThread.installProvider(ActivityThread.java:6762)
at
android.app.ActivityThread.installContentProviders(ActivityThread.java:6357)
Can anyone please suggest if I have missed anything in the progaurd file or any other configurations(In the build. gradle I have mentioned minifyEnabled true and also the proguard path).
You may use jar package include XmlPullParser class,so add this can solve it.
-keep class org.xmlpull.v1.** { *;}
-dontwarn org.xmlpull.v1.**

Related Links

Updating Android Listview Constantly but Retain onClick functionality
Parse + Facebook authorization: Callback already registered for <facebook>: com.parse.ParseFacebookUtils
Parse Dynamic Key Json String using Retrofit
How to override the android library class
ionic side menu content blank page
How to update the rows in parse.com using android platform if user reinstall the app or again open the app
Immediate Audio Input & Output Android
gradle build fails with aapt version / timeout error
How to identify/get called client id when using simultaneous dialing in Twilio
Sqlite - getting Index 0 requested, with a size of 0
How to wait to Snackbar ? I want to know when it is closed
Playing and downloading YT videos in an android application | Using PAFY
List View onItemClick is not working
Get country TelephonyManager vs locale.getCountry()
How to add self-defined button to android custom keyboard?
Android google analytics: INSTALL_FAILED_CONFLICTING_PROVIDER

Categories

HOME
google-app-engine
phpword
assembly
turing-machines
polymer
ggplot2
flex
mysql-workbench
jelastic
nuget
access
database-normalization
spring-data-mongodb
dojo
nested-if
babeljs
mvc5
opengl-3
joomla3.0
bing-maps
endeca
opengl-es-3.0
favicon
zerobrane
symmetricds
enterprise-architect
flash-player
magnetic-cards
cumulocity
forgot-password
google-picker
gmm
apache2.4
replication
systemtime
ember-cli
dataflow-diagram
angular-routing
imageresizer
dynamically-generated
syntax-highlighting
inversion-of-control
winexe
zend-debugger
deltaspike
kodi
wacom
linkedhashmap
hreflang
reactjs.net
pdw-file-browser
raft
odroid
signals-slots
watchface
wc
clang++
mschart
geotiff
java-bytecode-asm
appdomain
truezip
backbone-collections
excel-dna
boo
sandcastle
google-cloud-console
async.js
model-associations
udpclient
pre-build-event
freepbx
cda
sklearn-pandas
beanstalk
kendo-upload
lazybones
video-player
viola-jones
graphics2d
apache-commons-daemon
fail2ban
jbake
crowd
big-ip
spy++
strawberry-perl
mdichild
ignite-ui
cuba
cancellation
dot42
renderer
drupal-nodes
gwt-openlayers
sphinxql
mvc-editor-templates
node-blade
pagedown
frameworkelementfactory
saxparseexception
android-holo-everywhere
winmain
google-ajax-api
socketserver
ie-compatibility-mode
rowlex
feasibility
pbcopy

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App