I have an AAR project, and after every release I will be integrating it in to another application, we have enabled proguard for both host application and aar, and we have it working fine.
The problem is when we get any crash report from aar, we are not able to understand the cause and from it happened since the proguard is enabled, this issue happens only for crashes in aar. I have added rules for showing the line number and all but it is showing wrong line number.
Can any one help here ?
Related
I want to generate bundle for my project which includes three dynamic features , and this error occured while generating bundle.
also there is no 'split' attribute in my whole porject manifest anywhere , and the project is run on debug mode, successfully. but generating bundle not working.
any suggestion is welcome.
after 3 hours searching and finding Nothing , I decided to see that when exactly this log is generated by google inside building process of bundle. and I found out that it is creating the module with name base which will be used to merge all feature modules.
and also I Myself have one feature module in my project with the name of base, I wondered if there will be any conflict with this name that occurs this issue . so I refactored and renamed my own base module to baseCore and TADA ! everything works well . finally I must say , Hey google fu.. you and your fu..ing developers with your bullsh..t system which always waste our times because of ridiculous problems and cock&bull story generated logs and hints.
I was trying out the sample code posted for shinobi charts on android studio 0.8.0 from
https://github.com/ShinobiControls/shinobicharts-with-android-studio
I tried to import the shinobicharts jar as an .jar library .
It compiled perfectly , but I kept getting a runtime error and I have no clue what to do.This is the error displayed, the app never opens, just starts out with this crash
java.lang.NoClassDefFoundError: com.shinobicontrols.charts.R$styleable
at com.shinobicontrols.charts.ct.a(SourceFile:850)
It looks like you're running Proguard and it stripped out one or more needed classes.
Try turning off Proguard. If that gets past this problem, then you can turn it back on and fix its configuration file.
To fix it, you'll need to add rules to "keep" classes that it couldn't tell are needed. You can name specific classes or classname patterns. There might be a way to tell it to look at references from the library .jar to classes outside the library.
EDIT:
I have a solution for my problem, see below in the answers
I have searched and read all related questions on this issue, but none has worked for me.
I have an app which uses ViewPager Indicator as Library and it has a class application.
The app runs fine on the emulator, but when I try to export as signed apk.
Depending on the answers given for this exception and those which I have tried, it sometimes failed with error "Conversion to Dalvik format failed with error 1" or It exports correctly and crashes on the device.
Something peculiar though, when I run on the emulator, the apk generated is 600kb+ and when i export as signed apk it is around 300kb. It is somehow not referencing the library.
What I tried:
Default settings with only ViewPager referenced as library in the android properties
Adding JARs(ViewPager indicator and support ) in the libs folder
Any help will be much appreciated. Thanks
I found out that the issue was with proguard. If you have a class on the application level you should tell proguard to keep it public.
This is how I did it. I am currently using ADT20, I dont know if it is the same for older versions.
In file: proguard-project.txt
append this line (MyAPP being the class)
-keep public class <MyAPP>
In file: project.properties
uncomment this line
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
More info here:http://developer.android.com/tools/help/proguard.html#configuring
this is a copy of my question on Pubnub support page:
Hi all, I tried running the PubnubTestApp that is downloadable with the Pubnub API from your git repo.
but when I try and start the test app i firstly get a build path error because apparently you (pubnub guys) have configured the project to look for 2 jar files that don't exist. (bcprov-jdk16-145.jar and commons-codec-1.2.jar).
after I removed those 2 references the project showed no error. but when I tried running it, it crashed again with this error:
"07-04 12:29:11.782: E/AndroidRuntime(754): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.fbt/com.fbt.PubNubTestActivity}: java.lang.ClassNotFoundException: com.fbt.PubNubTestActivity in loader dalvik.system.PathClassLoader[/data/app/com.fbt-1.apk"
after looking over the internet for the reasons for this crash, I noticed that in the manifest.xml file in the project there is a mistake in the name of the activity name. (it's named ".PubNubTestActivity" instead of ".PubnubTestActivity").
after changing the manifest, everything works and the app will install and run but there a a few problems still.
when pressing the "publish" button or the "history" button the app crashes and dies automatically. also it crashed without any clicking of anything (just like that).
here are the crash reports I got from the emulator.
http://pastie.org/private/pojnpnxmznvn9azdg7uyg
apparently the project doesn't recognize the "pubnub.crypto" jar file even though I (and you) added it to the build path and made sure it's in the project.
please let me know how to fix this so I can use (at last) pubnub in my app.
Have you tried the latest build? This should be fixed now.
When I attempt to run my Android application I get the following message:
your project contains error(s), please fix them before running your application
All I did was to clean the application and everything went wrong.
Normally, you would see a red asterisk against the offending file and the corresponding line with the error. But in this case I get no such indication.
Screenshots:
Sounds like you have a syntax error in one of your XML files, or an invalid file name.
When you do a clean it deletes certain files, it would then automatically build, if you have syntax errors the R.java file won't be generated and you will have the above error.
you can check in android console(window->show view->console),it will give some more information,check it once,check your build path if your are import your project somewhere else and the project uses 3rd party libraries or you may have problems with your XML resources.
Found the source of my mysterious error.
It turns out it was a imported java class I had forgotten about which I wasn't using and caused the error to showup when I "cleaned" the project.
I visited the build path where I saw it had an associated error. I removed it and all was well.