Google Sign in failing due to SharedElementCallback - android

I have used pretty much the boilerplate from firebase and google sign on documentation. I get the dialog for choosing the account to log in from, and then it fails. I have updated my google play services. And also regenerated my sha1 keys. One thing that I have noticed is that android studio keeps giving me back the old key when executing the signingreport task, tho I have generated keys twice after that, and also updated on the firebase console.
Gist of the main activity on github
E/dalvikvm: Could not find class 'android.support.v4.app.ActivityCompat$SharedElementCallback23Impl', referenced from method android.support.v4.app.ActivityCompat.setEnterSharedElementCallback
E/dalvikvm: Could not find class 'android.support.v4.app.ActivityCompat$SharedElementCallback21Impl', referenced from method android.support.v4.app.ActivityCompat.setEnterSharedElementCallback
E/dalvikvm: Could not find class 'android.support.v4.app.ActivityCompat$SharedElementCallback23Impl', referenced from method android.support.v4.app.ActivityCompat.setExitSharedElementCallback
E/dalvikvm: Could not find class 'android.support.v4.app.ActivityCompat$SharedElementCallback21Impl', referenced from method android.support.v4.app.ActivityCompat.setExitSharedElementCallback

So, because android studio was showing me the wrong, originally generated key when running the signingreport task from gradle, I tried generating new keys but that wasn't working.
And then I found this which explained how to find the debug keystore in android studio and set it up. My android studio was taking its keys from the .android directory in my home directory while I was generating keys in a different directory. After configuring the keys through this, I also got an error saying the key strength was very less, but that was easy to solve(just add the -keyalg RSA argument while generating keys.
And then when I launched the app it said that due to CA certificates being no longer valid I should uninstall and install again. And voila, it worked.

Related

App crashes when downloaded from Google Play

I've just built and deployed an app to Google Play. It worked well when I was running it through Android Studio but now it crashes when I download it from Google Play. Because this is my first time, I don't even know how to view the crash report/stacktrace of the app that was downloaded from Google Play. I appreciate any and all help.
UPDATE
So I got the stacktrace for the APK. It tells me that my TopImageFragment.java class cannot create my MemeViewModel.java class. I have no clue why its giving this error. Everything works fine as it is. It seems that proguard is indeed phasing out an important class:
2019-04-18 00:46:32.062 8099-8099/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ozbek.onur.memegenerator, PID: 8099
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ozbek.onur.memegenerator/com.ozbek.onur.memegenerator.MainActivity}: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2853)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2928)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1609)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6703)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
Caused by: java.lang.RuntimeException: Cannot create an instance of class com.ozbek.onur.memegenerator.MemeViewModel
at android.arch.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:155)
at android.arch.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:210)
at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:134)
at android.arch.lifecycle.ViewModelProvider.get(ViewModelProvider.java:102)
at com.ozbek.onur.memegenerator.TopImageFragment.onActivityCreated(TopImageFragment.java:89)
This kind of problem usually happens because your app deployed to Google Play was a release build and proguard minified your app and removed a class it shouldn't have. When you build in Android Studio it is a debug build that does not get minified. That's why you see the crash only from Google Play.
Before uploading to Google Play, test out your release APK file on a device and watch logcat for the error. That should tell you what class got removed by mistake and you can correct that by specifying custom proguard rules and trying again until the app stops crashing. Then when you upload to Google Play, you should be good.
You can also enable proguard in a debug build as well by changing your build.gradle file. Then when you run through Android Studio, you should see the same error as you see through Google Play.
One other alternative, you can disable proguard/minification in your release build. However this is not recommended because your app will be larger than it needs to be.
Check if you have any java files that don't have an access modifier. In my experience, just declaring a class without a public or private modifier, causes this problem.
My app suffered the same problem and it was a ProGuard kill.
Because ProGuard renames all classes unless otherwise instructed.
So, in your case, you have to add
#Keep
annotation before your class name MemeViewModel.
example,
#Keep
class MemeViewModel{
//
//
}
In my suggestion, keep your phone connected to your your PC/Laptop while you download and attempt to open it. Use Logcat on android studio, it mostly has all answers or at least errors that lead to the answers. try putting error logs here so we can have a proper look at it.
1) Try the same version of your application that you deployed on Google play store by pushing it through the android studio and see if the problem continues!
2) If same thing happens then put breakpoint on the entry point (onCreate method in most cases in MainActivity class) of your application and Go to Run->Debug "YourProject" option and do step by step debug for each command being executed and see which one is causing problem.

How to use "mapping.txt" file for debug and error-exception handler for Release version in Android

I want to upload errors to the user in the app to the database server, but in the Release version, because it's used with Proguard, it does not correctly represent the classes that have encountered the error, as in the example Has been laid.
Sample error message
Attempt to write to field 'java.lang.String com.employe.school.Application.Message.c.c' on
a null object reference
Instead of "c.c", your actual class name will be displayed.
In general, I want to handle the App errors myself and do not use Firebase or other crash reporters.
Is there a way to solve this problem?
%SDK_DIR%\tools\proguard\bin\retrace mapping.txt errors.txt > fixed.txt
Do the work.
Android studio create mapping(build/outputs/mapping/release/mapping.txt) file under release folder for Release builds. You can use them to find out where the error is occured. Re-mapping is already implemented on Google Play Console and crashlytics. You just put mapping file with corresponding APK to play console and errors are shown correctly.

WeChat API failing registration in app

I'm developing an application for the Chinese market which will allow our users to login using WeChat. We have applied for a mobile application on https://open.weixin.qq.com and it passed.
I used the example project of WeChat to see how it works, and got it working fine (WeChatSDK_sample_Android).
Then I tried using our received AppID and have failed since then. When we try to call the register action we see following error pop up in the logcat:
Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}
The Package Name in the manifest and the applicationId in our build.gradle file are exactly the same as the package name we put in the wechat form. We first picked the SHA256 signature, but since then also tried the SHA1 and MD5 signature to see if it works (both with and without ':', all in UPPERCASE).
I also tried the chinese application that was referenced multiple times that can be found here https://github.com/mike623/cordova-WeChat-meteor-sharing/blob/master/README.md
I'm completely out of thoughts what I can change now to see if it works.
Here is where I got the appId from (where the blue is now):
Do you have any idea what I can try, or what I did wrong?
Kr,
Thomas
I also encountered this problem before. It is caused by incorrect Wechat app signature. Because the signatures of debug and release version are different, so that's why Wechat return
Server response error code:404, error:{"ret":-1, "msg":"invalid appkey"}.
How to solve this problem?
Download generate signature tool which is provided by Wechat:
https://res.wx.qq.com/open/zh_CN/htmledition/res/dev/download/sdk/Gen_Signature_Android2.apk
Open the tool in your Android device or simulator, then enter the package name of your app into the tool and get signature:
At last, check the signature in step 2 with the signature you submitted in the Wechat Open API Platform. If they are different, pls change the signature or build a correct version APK.

Google Map Api v2 shows "V/GoogleSignatureVerifier : signature not valid" error message in log

I am developing an Android application using google map api v2 to show a Map in a Fragment. When I run the application, I always got this error message poppin in my log every now and then.
Things I've tried:
Erasing the debug.keystore and rebuilding the app.
Downgrading the Google Play Service and upgrading it again.
Deselect Offline Work
Nothing does the trick so far...
Once upon the time in the Log tab :
2364-3928/com.example.android.app E/DynamiteModule: Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.android.gms.googlecertificates.ModuleDescriptor" on path: DexPathList[[zip file "/data/app/com.example.android.app-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.android.app-2/lib/arm, /data/app/com.example.android.app-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
2364-3928/com.example.android.app I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:1
2364-3928/com.example.android.app I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 1
2364-3928/com.example.android.app W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/m/00000000/n/armeabi
2364-3928/com.example.android.app D/ChimeraFileApk: Primary ABI of requesting process is armeabi-v7a
2364-3928/com.example.android.app D/ChimeraFileApk: Classloading successful. Optimized code found.
2364-3928/com.example.android.app D/GoogleCertificates: com.google.android.gms.googlecertificates module is loaded
2364-3928/com.example.android.app D/GoogleCertificatesImpl: Fetched 154 Google release certificates
1921-2130/? V/GoogleSignatureVerifier: com.example.android.app signature not valid. Found:
MIIB3TCCAUYCA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/z84DJuo34z1g
lahfkNPR/mCsYkK+ZqkC6uR46NnoftoKC/9vJSlUxYaBLT+mWvApz4rUKuMCAwEAATANBgkqhkiG
9w0BAQUFAAOBgQAERId+C7AD5Ew4Jv4mTmaZWBUtkinCKFSF4RtVa3xnHjL5xDPbAEq829gt+yx7
FkftGZO1x5nWEdAWyxiZgET3sKyl4ejRu1V5qvTMOcPMaVHw/e5v97FK8q756tQBcAu+Zs77P6MW
RxXtAwqeIkV1+L1rY8WueawfQ7Wbm1bPOg==
1921-2130/? V/GoogleSignatureVerifier: com.example.android.app signature not valid. Found:
MIIB3TCCAUYCAQEwDQYJKoZIhvcNAQEFBQAwNzEWMBQGA1UEAwwNQW5kcm9pZCBEZWJ1ZzEQMA4G
A1UECgwHQW5kcm9pZDELMAkGA1UEBhMCVVMwHhcNMTYwNTE3MTYxNzM0WhcNNDYwNTEwMTYxNzM0
WjA3MRYwFAYDVQQDDA1BbmRyb2lkIERlYnVnMRAwDgYDVQQKDAdBbmRyb2lkMQswCQYDVQQGEwJV
UzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAkafVu0j1zuB6+cpo6q5OsfhrlEFzVknFNs0c
vJorrlTTPZK3WSmkX9jZ0cp6oL60+4mHPouAR7Hq72gAs8u9Zh3eVrnV7uP7Rv2/z84DJuo34z1g
lahfkNPR/mCsYkK+ZqkC6uR46NnoftoKC/9vJSlUxYaBLT+mWvApz4rUKuMCAwEAATANBgkqhkiG
9w0BAQUFAAOBgQAERId+C7AD5Ew4Jv4mTmaZWBUtkinCKFSF4RtVa3xnHjL5xDPbAEq829gt+yx7
FkftGZO1x5nWEdAWyxiZgET3sKyl4ejRu1V5qvTMOcPMaVHw/e5v97FK8q756tQBcAu+Zs77P6MW
RxXtAwqeIkV1+L1rY8WueawfQ7Wbm1bPOg==
1921-2130/? V/GoogleSignatureVerifier: com.example.android.app signature not valid. Found:
MIIB3TCCAUYCAQEwDQYJKoZIhvcNAQEFBQAwNzEWMBQGA1UEAwwNQW5kcm9pZCBEZWJ1ZzEQMA4G
A1UECgwHQW5kcm9pZDELMAkGA1UEBhMCVVMwHhcNMTYwNTE3MTYxNzM0WhcNNDYwNTEwMTYxNzM0
WjA3MRYwFAYDVQQDDA1BbmRyb2lkIERlYnVnMRAwDgYDVQQKDAdBbmRyb2lkMQswCQYDVQQGEwJV
UzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAkafVu0j1zuB6+cpo6q5OsfhrlEFzVknFNs0c
vJorrlTTPZK3WSmkX9jZ0cp6oL60+4mHPouAR7Hq72gAs8u9Zh3eVrnV7uP7Rv2/z84DJuo34z1g
lahfkNPR/mCsYkK+ZqkC6uR46NnoftoKC/9vJSlUxYaBLT+mWvApz4rUKuMCAwEAATANBgkqhkiG
9w0BAQUFAAOBgQAERId+C7AD5Ew4Jv4mTmaZWBUtkinCKFSF4RtVa3xnHjL5xDPbAEq829gt+yx7
FkftGZO1x5nWEdAWyxiZgET3sKyl4ejRu1V5qvTMOcPMaVHw/e5v97FK8q756tQBcAu+Zs77P6MW
UPDATE
I'm still having the error message, does anyone fix it since then?
/com.example.android.greenLeaf V/GoogleSignatureVerifier: com.google.android.gms signature not valid. Found:
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMw
EQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29n
bGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEz
MzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYw
FAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5k
cm9pZDEQMA4GA1UEAxMHQW5k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aTCK
When You make signed apk then you have to put SHA-1 Of that keystore in Google Api console where u enabled GoogleAPI V_2 enabled.Then Generate API key again and put that API key into your manifest file.
Apparently it's a known issue acknowledged by a google developer
stating this in a more recent post:
Sorry, thats a bug! It's just spurious logging though: Google Play
services does some checking to see whether you are a Google app or a
regular third party one.
As part of that, it calls the signature verifier and the logging ended
up more verbose than intended - it will be fixed in a future
version.This shouldn't affect the behavior of your app at all.
So it should just be ignored until the future update...
By checking the internet for the other people who encountered the same problem of yours, in updating Google Play Service to 9.0.83. I found a discussion here on how to solve that problem. You can try to check it, if it can help you.
Some solution is by checking if you have enabled offline work for gradle, deselect Offline Work if it's checked. Then, confirm if you have latest version of Google services mentioned as dependencies in project level build.gradle: classpath com.google.gms:google-services:2.1.0. Clean and build the project after the gradle sync completes.
Try to update the SHA1 key in your project on Google Developer Console and update the Maps API key in your android project.
Also, some people fixed it by just deleting the debug.keystore file found in the android folder.
As per Ian Barber's comment in this answer Google Play services version 10.0.1 will fix this issue.
Updgrade to the latest version (10.0.1 last time I looked), should go
away.
Hope this will help you.
Happy coading!!!
Add this in project level gradle file:
classpath 'com.google.gms:google-services:2.1.0'
and this one for module level gradle file:
compile 'com.google.android.gms:play-services:8.4.0'
and move below plugin at the end of file (at last line) of module level gradle file:
apply plugin: 'com.google.gms.google-services'
I have fixed it by deleting the debug.keystore file found in the .android folder.
It will generate automatically and create new SHA1 using that file.
Gnah. This was bugging me for hours! Just deinstall the updates of Google Playservice 9.0.83. Version 8.7.02 is working here. Also keep this posting in mind: https://plus.google.com/+ChristopheBeyls/posts/LC2XCSoaVBJ
you should change Map api v2 to v3 :- Map API V3 coz of Version 2 of the Google Maps JavaScript API is no longer available. This guide is intended to help developers who are already using the Google Maps JavaScript API v2 migrate their code to version 3.

Android Google Maps gives a ClassNotFoundException

I am creating an app tht uses Google Maps API v2. It works fine, except for a little annoying this, when I use the setMyLocationEnabled(true); method, I get a ClassNotFoundException. I can just click "Resume" and the app continues. When running without debugger, there is nothing you can see happening.
This is what LogCat is saying:
09-23 22:39:31.645: I/dalvikvm(2067): Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lglm;'
09-23 22:39:31.645: W/dalvikvm(2067): Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
09-23 22:39:32.473: W/dalvikvm(2067): VFY: unable to resolve static field 4203 (CREATOR) in Lcom/google/android/gms/location/internal/ParcelableGeofence;
It looks like a missing class in the library, and if I jump into the library project, I indeed do not see that class.
Is there anything I can add / fix to make this exception go away?
I have seen that logcat error before and I noticed it is due to mismatch in my API key between debug and release mode. If you are using separate key store for debug, please make sure you have included both debug and release SHA1+package.name combos in the Google Dev Console.

Categories

Resources