I have submitted an app to the Amazon app store. It has been rejected twice now for the same reason, but I can't find the problem. It crashes right at the start, usually 2-3 activity windows in. This error never happens on our test devices, and there hasn't been a single error or crash from the app on the Google market. So thus far I've been completely unable to replicate the error.
On the last rejection we requested a stacktrace, which they sent, but only with errors, not warnings, which from what I gather is what I need to find out exactly what method is causing the Java.Lang.VerifyError from W/dalvikvm. Is it reasonable to assume that when they decompile the app, and inject their amazon drm/tracking/whatever code into the app, and recompile it, it's causing clashing errors with some of my code? or that Amazon are possibly compiling on a different version of Java than we are? (ours is 1.6)
The app has both minSDK and targetSDK set to api8, which is 2.2 minimum, and we compile it against 2.2, Has anyone else had this error with Amazon before and might be able to give me some insight as to how the problem was resolved?
Thanks
Found the problem. In the Manifest there was a .java file that was declared as an activity, which it was originally, but it had been changed to extend Dialog instead.
When Amazon injects code into your app, they look at the manifest to find the Android Activities, and inject code into them such as callbacks and method overrides, some of which are specific to the Activity class. When Amazon looked at my manifest, they thought the class was an Activity, but it was actually now a Dialog, and the app was crashing when trying to override methods that didn't exist.
Once removing the manifest declarations to the classes that weren't actual Activities, the app got approved. Its weird that google and eclipse didn't pick up on the declared activities that weren't activities when the app got compiled.
Hope this can help others who cant seem to find out the reason their apps not getting approved by Amazon.
Related
I have an app written in Kotlin which contains an Activity that is a child of NativeActivity. It runs fine.
I cloned that app to create another one with similar functionality, and it deploys the APK just fine - but it crashes at runtime because ANativeActivty_OnCreate() is an unknown symbol.
I don't understand how it could even link and get packaged without that symbol being known, but also because it works fine in the original app. I'm at a loss for where to look for the cause of this issue. Has this happened to anyone else? What are some things I can try to resolve the problem?
I'm having a problem where an app I'm developing is working on mobile devices (tested on 4 different devices), but crashing when I try to test it on my tablet. The tablet I'm using is a Tesco Hudl 2, which, although being a good quality low cost device, lacks adb drivers and so you can't debug apps through USB and get the Logcat data. The app was developed using Android Studio.
With other apps I have developed, I have just set up ACRA in the project so I can still get debug information from a crash. This time however, the app is crashing without any information from ACRA and so I'm not quite sure what is going wrong. I'm pretty sure I've set up ACRA correctly given that I've used it in several projects before and see nothing wrong this time. Can it be that whatever is going wrong is happening too early for ACRA to catch?
I have pulled out all the code from the activity so the only thing that happens in code is that ACRA gets initialized in the derived Application class (note that the crash exists without ACRA). The app also uses Google maps and a provider for search suggestions. If there is any code anyone wants to see just ask, but I'm unsure what exactly to post up since everything else was stripped out. So, does anyone have any idea on what I can do to solve this, or what tools I can use to catch whatever sort of errors happen so early in the apps lifecycle?
Thanks
Update with strange behaviour... Downloaded Crashlytics and it also did not catch the crash. I copied the project and removed every .java file except the Application, Activity and provider. The provider functions were empty (save for the return value of 0/false/null/whatever), the application class just initialized Crashlyitcs and the Activity class was empty. This then worked, I was even able to add in a lot of the code and get the google map to load.
Now if I do the same in my main project, except don't delete the .java files, the crash still happens. The classes in these files are not used so I have no idea how they can be causing the crash. Otherwise all the xml, gradle, resources are identical (except the package and app name). Very confusing...
Consider using one of the apps to view logcat on the device:
https://play.google.com/store/apps/details?id=com.nolanlawson.logcat
https://play.google.com/store/apps/details?id=org.jtb.alogcat
Also try using Crashlytics. Maybe it will catch your crash?
But yeah, it's possible to have a crash before any crash reporter (ACRA or Crashlytics) will have a chance to catch it.
And one more note, maybe there is a way to enabled ADB over WiFi.
Normally you would need to enable it via adb but maybe in case of this cheap and strange tablet, there is an option for that enabled in the ROM?
Ok! So it's 1am and I decided to have one final attempt to fix, which I think I did. In my manifest, I had things like
<activity
android:name=".MyActivity"
...
for example, and while this worked fine on the mobiles, for some reason the Hudl required the complete package name, i.e. com.mypackage.MyActivity. Not sure why this is the case but it appears to have fixed the problem.
I've recently added Wear functionality to one of my apps, and I started seeing an obfuscated crash being reported. I've updated the app a few times since then, which included using newer Google Play Service versions. Here's the crash:
java.lang.IllegalStateException
at com.google.android.gms.internal.aa.f()
at com.google.android.gms.internal.r.a()
at com.google.android.gms.common.api.b.bl()
at com.google.android.gms.common.api.b.d()
at com.google.android.gms.common.api.b$2.onConnected()
at com.google.android.gms.internal.r.a()
at com.google.android.gms.internal.r.x()
at com.google.android.gms.internal.q$g.a()
at com.google.android.gms.internal.q$g.d()
at com.google.android.gms.internal.q$b.bQ()
I've looked at any place in my code that uses onConnected, and I can't find anything that would cause an ISE. Anyone see anything like this, or know what it is?
I'm tired to see a lot of Stackoverflow questions about this, even in Google forums or Google official support site, publishing "solutions" that lead to uninstall package through ADB, to do something with the phone rooted, to delete cache of Google Play Services, etc ...
https://code.google.com/p/android/issues/detail?id=64514
https://support.google.com/googleplay/answer/3300875?hl=en
http://gizmostorm.com/how-to-fix-package-file-is-invalid-error-on-google-play-store/
https://www.google.com/search?sourceid=chrome-psyapi2&ion=1&espv=2&ie=UTF-8&q=android%20upgrade%20download%20invalid%20package ...
etc ...
Is there any solution from the package side ?
I mean, I have an app with hundreds of thousands of installs, and unfortunately many users are complaining about this error when upgrading from store my new version.
Obviously, I can not go one by one telling they have to do this or that, because they are not developers, they just want to upgrade and run an app !
Some users are telling me (complaining) this happened since the last "upgrade attempt" of my app, and they are not experiencing this "package file is invalid" with any other app in their phones.
So, I guess it's something I can fix with another upgrade.
Is there ANY SOLUTION that I can do in the next APK compilation, uploading to Google Play Store and fix this without "bothering" my users ?
Thank you in advance
I have also faced same issue in my project as well. I was adding many more features with new jar, git open source library code for Nice UI.
For searching for solution I found play store has issue in one of its updates
http://www.androidcentral.com/google-investigating-package-file-invalid-errors-google-play
But this is totally not relevant to my problem
Again searching I found this
http://birbit.com/how-to-solve-linearalloc-problem/
So the solution looks to be loading a few jar files dynamically using DexClassLoader.
http://android-developers.blogspot.in/2011/07/custom-class-loading-in-dalvik.html
Prepare Interface of the jar file (list of all classes and methods) and have the interface in the app - Need to see how to do this. - We can just have those classes which we need in our app and ignore the rest of the classes. This way we can implement for few existing jars and any new jars that we have to add to make sure we don’t run into this issue again.
Keep the jar in assets folder
Load every class from the jar (based on the list of jars we have in the interface). (The classes will be loaded just once on first launch)
But Based on this, this looks to be involving lot of coding changes and a time consuming things.
Moreover I found that facebook also faced same issue in their initial android app
https://www.facebook.com/notes/facebook-engineering/under-the-hood-dalvik-patch-for-facebook-for-android/10151345597798920
Final Approach I took was removing additional code from jar/git library project which is not require for my application. after that my app got install on 2.3.X with no error.
My app had been chugging along fine on the Android market until last night when it was reported a customer found an error. The customer must have downloaded the latest version of the app because he tried to use it again with the latest version and the error came back.
I looked at the stack trace of the error and found it was caused by a NullPointerException when passing information between two activities, namely with the onActivityResult() method.
I checked the code and can't find what could have caused the error. I tried to figure out what steps the user took to get the error, but found nothing wrong, on the emulator Android 1.6 /Android 2.2 and my own phone (Android 2.2). I couldn't find any problems no matte rhow much I tried to crash the system.
Another thing that is strange is that the particular onActivityResult method is called a lot in my app. So it is odd that only one user has reported problems.
Also, it says the user's platform is "OTHER". I don't know what device that could be.
So my questions are:
1) Could this problem be an issue with the user's device and not my application?
2)What to do when you cannot find the cause of a crash?
1) Yes, they may have a custom ROM; they're known for doing things like this.
2) Unless you can reproduce it, you [probably] can't fix it.
Can you contact this customer? If not, there may be nothing you can do.