I have setup a project in Firebase to run Instrumented Test for my app. I created the project from Android Studio, then I went to the Firebase Console and moved the project to Blaze Plan. I logged in and setup the project in Android Studio, so far so good, the thing is that when I try to run the test in Firebase using the Sample Spark Configuration but Android Studio never finishes to upload the APK, I don't have any error neither, what I get in Android Studio RUN console are the following lines:
Testing started at 11:29 ...
Using Cloud Storage Bucket location test-bucket-id
Uploading app APK ...
So, it seems there are some issue witht the bucket or with the project, but I'm not able to read any error anywhere. So, where can I access any log to know what is going on? Does a firebase project expose logs though its web UI or does Android Studio allows me to get some kind of logs besides what I get on the build window?
I had the same issue. Turned out there wasn't anything wrong with the project or the bucket. All I had to do was specify the package of my instrumented tests instead of using the "all in module" option in the run configuration.
Related
I followed this tutorial to create tests in android studio: https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests#run-ctl. I successfully ran those tests on my physical device. Then I created the test run configuration for test lab, also followed the same tutorial. When I want to run this configuration I am receiving the following error:
What am I doing wrong? Why am I not authorised for my own project? I was able to add my firebase project normally. I am using only free spark billing in Firebase.
When you prepare your test run configuration, make sure you select your Firebase project (the one you created and to which you have access) from the list of all cloud projects you see. Also, if you created your project after your login in Android Studio, it might help to log out and re-login (using the icon in the top right corner of Android Studio).
Using android studio, I created an app and linked it to a Firebase project.
I opened the app on my android studio recently and discovered it wasn't linked to my Firebase project any longer. I checked the Firebase console and saw that the app was still connected. However, it's still not reflecting in my android studio.
When I try to connect my app to Firebase (afresh), I can clearly see my Firebase project as one of the options (with one app connected ==> my app).
In summary, how do I reconnect an app to firebase?
I have tried restarting my android studio, cleaning the project, invalidating cache and restarting.
As long as there is no external tampering with an android studio project, an android app would always remain connected to Firebase.
I was able to solve this problem by signing out of all my Google accounts and then signing in with the account associated with the project. All I had to do after was attempt to reconnect again and kAbOoM, it worked fine.
There are two extra checkers/fixes I'd recommend to anyone that runs into this problem:
Check whether the google-services.json file exists. It's usually in the /app directory of android projects. If this file does not exist, it means the app is not connected to any Firebase project. One can then proceed to connect one's app to Firebase either manually or on the android-studio IDE. If the file exists, proceed to 2.
Dependencies: A lot of Firebase-type problems stem from dependency issues. Ensure the following:
Avoid version conflicts Ensure that all dependencies are up-to-date Take warnings seriously, they are like seedling-errors
I hope this helps other people who might run into this error.. Merry coding!
I have a team working on a project which uses Firebase for storing data and Google Sign in for authenticating users and their own stored data.
The problem is that everything works fine on my computer when I run the application through Android Studio (tried on 3 mobile phones), but when I share my code with my team through Git, they cannot sign in for some unknown reason. Then I've built an APK file and suddenly it all worked (they managed to run application on their phones).
Can anyone explain what is the main cause of this problem and how could I possibly edit the project to deliver a working project to my teammates on Git?
Your teammates should add a SHA fingerprint to your project in the firebase console. You can do that in your project's settings -> general and "ADD FINGERPRINT"
I'm investigating a cloud-based solution for our UIAutomator 2.0 testing needs, and I'm having quite a few issues with uploading APKs for our test project.
We have a stand-alone test project that exists separately from the main Android application project. The package for the project is in the format com.company.project and the package for the test project is com.company.project.test.
1) If I attempt to upload a test APK that has all the tests in androidTest (and the gradle uses androidTestCompile for dependencies), Firebase console complains that:
"Unable to find instrumentation package for com.company.project.test"
This is likely because our test project is standalone, and the tests actually live under com.company.project.test.test.
2) On the other hand, if I change the location of tests to java main folder in the project and change androidTestCompile to compile for the gradle dependencies, when I attempt to upload the test APK Firebase console complains again:
"We experienced an error while validating your APK. Please verify the APK is correct and upload again."
I can't get a single test running since I'm blocked both ways.
Anyone else attempt to use Firebase Test Lab with a similar project hierarchy? Help!
Finally figured it out. Don't even bother with the web UI, use the gcloud terminal to run your tests instead. It's WAY more customizable.
https://cloud.google.com/sdk/gcloud/reference/firebase/test/android/run
You can specify the --test-package to whatever your test package is, whether it's a standalone project or not.
I am new to Android Studio and have just runned through the tutorial
https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/GcmEndpoints
without much trouble.
However, when I try to deploy my backend to the app server it promts me: "You must be logged in to perofrm this action".
I have no idea of why it teels that. I can easely find me project on the list, and Im logged in to my google acount on various browsers including Chrome.
Have seached the internet, but found no one else with the problem before.
Best Regards Allan
It's possible that your auth has been done a little while ago and the system cannot properly see you authenticated anymore, which would explain such a behavior.
At the bottom of the list of projects, you should see a "add account" button. Click on this and just re-auth. Should clear the bad tokens :).
Steps For Intrgration of App Engine Endpoints Module.
.....................................................
1-:Create an Google Devloper Console Account.Create a new project after completing the project creation they give you a Project id and project no.
2-:Open Android Studio File-->New-->New Project.
3-:After Project creation is completed Right Click On your project select Module-->Google Cloud Module as shown in images folder chouse_module image.
4-:When you Select The Google Cloud Module Then choose "App Engine Java Endpoints Module".as shown in images folder endpoints image.
5-:As soon as the backend module is added to your project and Gradle sync finishes,a new run configuration with your backend's module is created.
6-:Rebuild your project via "Build → Rebuild Project"
7-:Now Check Your Backend started sucesfully naivigate to http://localhost:8080.if your Backend started sucessfully you saw the screen as as shown in images folder devappserver-endpoints image.
Connecting your Backend to your android project.
...........................................................
8-:After Backend Module is created and added strong libraries is automatically genrated for you.
9-:To start sending requests to the added Cloud Endpoints backend API.you Have to created one Async Class in your Project file.you Can Get the Async task class in required Packages folder with name AsynctaskClass.java
10-:To make the actual call, invoke this AsyncTask from one of your Android activities.In this way :: new EndpointsAsyncTask().execute(new Pair(this, "Message"));
11-:Ckeck that you granted an internet permission in menifest or not.
12-:Now check that you have accese to local host as shown in point 7.
13-:Its time to Check in Emulator Change your Run confrigation and run your project If everything goes well, you should see the following toast in your app as shown in images folder emulator-Toast image.
Deploying the backend live to App Engine
......................................................
14-:If your backend is working locally, you can deploy it to Google App Engine.
Stop the backend, if it is running locally, by selecting Run > Stop.
Than navigate to Build > Deploy Module to App Engine.
15-:update your src/main/webapp/WEB-INF/appengine-web.xml file's property and replace myApplicationId with the ID of the project that you just created.as shown in point 1.
16-: you can see the screen as shown in images folder deploy-image image.
17-:In the Deploy to you have to select the project you created on Google Devloper Console.as shown in point 1.
18-:Put the version name and click deploy Button.
19-:Once you have deployed your backend to App Engine, you can connect your Android app to it by modifying AsyncTask class defined in point 9 replace the perticular lines shown in ReplaceCode.java file in required Packages folder.
20-:Now you can communicate with your new App Engine backend!.
For More Info -:
https://github.com/GoogleCloudPlatform/gradle-appengine-templates/tree/master/HelloEndpoints.
https://cloud.google.com/tools/android-studio/app_engine/add_module?hl=en.
Ive never used android studio but Im sure its like eclipse sdk puglin.
There is an easy way to deploy ur apps on ur mobile device, but before u get to that point u need to eanable android mobile on debug mode (On settings,developer options).Once u have done that, Im pretty sure there is an option which lets u run ur app on android device making much smother than doing it virtual app.
Hope I helped ya...
Use the gradle commands.
Open the terminal within android studio and run
gradlew appengine:update
Or navigate to the gradle project window and look for the google appengine folder under your backend. And double click the appengineUpdate command.
Adding the backend with android studio should automatically add the appengine plugin for gradle in your backend build.gradle file like this. This plugin is allows you to run the appengine update command.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.appengine:gradle-appengine-plugin:1.9.18'
}
}
I was facing similar issue using Android Studio Ver2.2 in Ubuntu 14.04
I was not able to do sign-in into Android Studio using the SignIn icon from top-left of the Android Studio IDE. When signin icon clicked, a pop-up says that Sign-in using external browser but nothing would pop-up.
Build->Deploy to app Engine->Deploy to tab was also showing the same message as above but no browser would pop up
Even gradlew api:appengineUpdate was not working. (no browser would pop up).
Problem got resolved by changing the File->Setting->Web Browsers (it was listing browsers Chrome, Firefox, Safari in that order). The Default Browser was set to "First listed". I unchecked the chrome and my problem got solved, I was able sign-in and deploy my project.
I spent lot of time finding solution for this, thought it might help others, so posting it.
I had the same issue.
I did not realize it at first but when you get this message, you simply click on the dropdown "Deploy To", and then it invites you to log into your google account.
It is not very intuitive if your project is already selected by default.