I have problem with Google Drive.
After I'm clicking on dialog with email Im getting error:
statusCode=SIGN_IN_REQUIRED
I resolved this problem by adding in gradle
debug {
signingConfig signingConfigs.config
}
signingConfigs {
config {
keyAlias '******'
keyPassword '******'
storeFile file('C:/Users/.android/debug.keystore')
storePassword '******'
}
}
But the question is it is possible to work without this file and this options in gradle?
I'm pushing this code to repository and tests are failed in case of missing debug.keystore file.
Code will be published and I'm not sure can also share this debug.keystore file?
I know the easiest is to add this file in to directory app and change the path.
But maybe someone know better solution?
You may want to check Authorizing and Using REST APIs which shows how to authorize with Google and use Google REST APIs when you want your app to access Google APIs with the user's Google account over HTTP. There are also given approaches that you may try for your app.
Check the following to authorize your Android app:
Configure build dependencies in your app's root-level build.gradle file.
Use the Google-Provided authorization UI for REST API access. Use the Auth.GoogleSignInApi method to give users of your Android app a Google-provided authorization UI that handles all of this.
Specify scopes by creating a GoogleSignInOptions object with the new scopes that you want to request by calling GoogleSignInOptions.Builder.requestScopes.
You can get an Android Account object as part of your Google Sign-In result, and you can later instantiate a GoogleAccountCredential object with it.
Use GoogleAccountCredential and the client library for REST API access.
For more information, please also see Authorizing Android Apps.
I resolved this problem by adding in gradle
debug {
signingConfig signingConfigs.config
}
signingConfigs {
config {
keyAlias '******'
keyPassword '******'
storeFile file('C:/Users/.android/debug.keystore')
storePassword '******'
}
}
Related
I recently uploaded my first Kotlin-Android app to a closed testing (alpha) track in Google Play Console. The review was complete and I shared my link to some testers. Unfortunately the release bundle has major bugs that are not present in the debug APK! (the one that generates automatically when I hit "Run" in Android Studio). I checked both bundles on my device and the debug version works perfectly fine while the release is unusable. Is there anyway to debug a release version??? Or maybe create a debuggable build that mimics it's behaviour (as a release build is set to be undebugable for safety reasons...). Is there a way to see the app logs? (or are they removed in the release build?)
I think it's important to mention that all bugs are related to Firebase actions. My Firebase project have all the needed "SHA certificate fingerprints" (SAH-1 & SHA-256 for the debug, upload & app-signing keys). Maybe another thing is missing?
Maybe the specific bugs can point to the root of the difference, so these are my 2 biggest bugs:
Each user document holds a list of items which is shown in a recyclerView in one of his screens. In the release version no item is shown. I checked the Firestore console and the items are added successfully (from any version) and they show when I sign in the same user with the debug version.
Can't sign in via phone number (in Firebase auth pre-built UI). The other methods work fine. I can even link a phone to an existing account, but the pre-built sign-in flow stops after I enter a phone number and resets to the initial screen. In the debug version that works fine.
Did someone encounter anything like that?
Any help would be appreciated.
I found the way to debug the release bundle. The problem was that the "release" build variant used the default signing key - the debug key. I had to Configure the build process to automatically sign my app with a secured key. At the end, I have the following code in my "build.gradle (:app)" file:
...
def keystorePropertiesFile = rootProject.file(<keystore.properties file location>)
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
signingConfigs {
ionce {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
...
buildTypes {
release {
...
signingConfig signingConfigs.ionce
}
}
...
}
...
(I choose to Remove signing information from my build files. If you do, pay attention to the "\" orientation in the storeFile field as the error is not very informative. This answer helped me)
If anyone also encounter one of the two issues I mentioned, here are the solutions:
The difference between the build variants was that in my "release" variant I use minifyEnabled true, which changes the attributes' names to minify the code. When getting the document from Firestore it did not match the object structure and failed to load the list. The solution is in this answer.
This one was not related to the difference in build types - seems I didn't check the feature after upgrading firebase-auth library in my gradle. Upgrading the firebase-ui-auth library, like in this answer, did the trick :)
you can add this debuggable true in your gradle file
release {
debuggable true
minifyEnabled false
shrinkResources false
}
this will help you debug the release version, make sure that minifyEnabled and shrinkResources are false
to run the Release version of the app with the Release Keystore use this
signingConfigs {
release {
storeFile file('file location')
storePassword 'your store password'
keyAlias 'your key alias'
keyPassword 'your key password'
}
}
and then add in the variant of release this
release{
signingConfig singingConfigs.release
}
I made this Android app that fetches some data using AI Platform Training & Prediction API from Google Cloud Platform. For this app to work it needs to be approved by GCP using SHA-1 Fingerprint certificate. I am making this app as an assessment for module Im taking at the university, so, when the teacher will open my Android Studio project it will have a different SHA-1, so the app will not fetch the data...
Any Ideas how I might be able to maybe set a permanent SHA-1 key for my project, so when the teacher will open the project, Android Studio will not generate a new one?
Thank you!
The SHA-1 is based on the app signature. Since this is for a project I suggest you do the following (never do this in a production app).
Create a new signing key (Build -> Generate Signed Apk -> APK ->
Create New)
Move the signing key to your project's folder
Add this to your app.gradle
android {
signingConfigs {
debug{
storeFile file("your_key.keystore")
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
release {
storeFile file("your_key.keystore")
storePassword 'password'
keyAlias 'alias'
keyPassword 'password'
}
}
}
EDIT: Forgot to mention, run the signingReport gradle task after you do this to get your new SHA-1 that you have to add to your project.
after creating the .keystore file and running the report I get the new SHA-1 key, but the build fails. I get this:
Entry name 'play-services-ads-identifier.properties' collided
My app was previously built while in the expo managed workflow. I did this using expo ba. Because android apps require that you release your app before you can add in-app-purchases, I uploaded this apk and released a beta using it.
I needed to switch to the bare workflow in order to implement in-app-purchases. Now, when trying to create a build to release the actual app, I am following the React Native instructions but must create another upload key in order to create a build(which is an aab this time).
On the play console it states
Upload key: The key you use to sign your first release. Sign every
subsequent release with the same key to verify it’s from you. Keep
your upload key safe. If it’s ever lost or compromised, contact
developer support to replace it.
I'm pretty sure this is a problem because I used whatever expo was giving me to sign the original apk.
I also cannot delete my original app and create a new app with the same bundle name because once an app is released it cannot be deleted.
To get the previously used keystore file run
expo fetch:android:keystore
Which will display something like
Keystore credentials
Keystore password: MYAPP_UPLOAD_STORE_PASSWORD
Key alias: MYAPP_UPLOAD_KEY_ALIAS
Key password: MYAPP_UPLOAD_KEY_PASSWORD
Path to Keystore: /Path/To/my_upload_store_file.jks
Edit the file android/app/build.gradle to include the information above
...
android {
...
defaultConfig { ... }
signingConfigs {
release {
//if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
storeFile file("MYAPP_UPLOAD_STORE_FILE")
storePassword "MYAPP_UPLOAD_STORE_PASSWORD"
keyAlias "MYAPP_UPLOAD_KEY_ALIAS"
keyPassword "MYAPP_UPLOAD_KEY_PASSWORD"
//}
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
...
Place my_upload_store_file.jks inside android/app
Edit the file ~/.gradle/gradle.properties or android/gradle.properties, and add the following
MYAPP_UPLOAD_STORE_FILE="my_upload_store_file.jks"
MYAPP_UPLOAD_KEY_ALIAS="MYAPP_UPLOAD_KEY_ALIAS"
MYAPP_UPLOAD_STORE_PASSWORD="MYAPP_UPLOAD_STORE_PASSWORD"
MYAPP_UPLOAD_KEY_PASSWORD="MYAPP_UPLOAD_KEY_PASSWORD"
Run the following in a terminal from the directory android
./gradlew bundleRelease
This will produce a file called app-release.aab inside the directory android/app/build/outputs/bundle/release/.
Upload this file to the Google Playstore console
So i tried a lot of suggestions online, saw a lot of people have similar problems with it.
So i signed the app for release, generated to keys( understood is better to add to the google maps api release.xml a different key from the debug one) and added the sha1 for the release on console google play after my keystore, still no results.
The only thing i observed and may be a solving is when i am trying to run the app i get the error(1) that states my app is not signed. And found online that i need to go to project structure and sign it -> build types->release -> chose my config. but after i press ok the config dissapears and gradle(3) remains unchanged. ( Would like to mention that in the Project structure i get 2 errors about my SDK/ NDK(2) that says their location should`t contain white spaces but i understood there is no real problem)
Please help, i`ve tried everything i could find.
Thank you,
Daud.
Maybe you can define your signingConfigs in your gradle file manually?
Something like this:
signingConfigs {
config {
keyAlias 'YourKeyAlias'
keyPassword 'YourKeyPass'
storeFile file('./yourKeyStore.jks')
storePassword 'yourStorePass'
}
}
and specify your configuration in buildTypes:
release {
...
signingConfig signingConfigs.config
...
}
I can't find any reason why the store doesn't accept any apks on new apps and others, it every time return please upload another apk
1.0, app code 1 brand new app returns same error with 2 different dev accounts on 4 different vpn(Netherlands/germanmy/singapur..) and 2 different browsers?(opera/safari) also I have deleted cookies etc
my signin in that project is react native
signingConfigs {
release {
storeFile file("key.jks")
storePassword "dosa"
keyAlias "dsa"
keyPassword "dsa"
v2SigningEnabled true
}
}
You will have to set
android:debuggable="false"
in application tag of the manifest file. This is important for uploading your apk.
and if this already set properly and Google Playstore still rejects your APK, then modify your build.gradle
signingConfigs {
debug {
storeFile file("my-keystore-file.jks")
storePassword "my-password"
keyAlias "my-alias"
keyPassword "my-password"
}
}
This will set your own key for debugging.
If your problem still exists then I would suggest reading the documentation, you can read it here it's given properly.
1.0, app code 1 brand new app returns same error with 2 different dev accounts on 4 different vpn(Netherlands/germanmy/singapur..) and 2
different browsers?(opera/safari) also I have deleted cookies etc
I tried with Firefox and it worked thanks...