I'm learning to work with Firebase within Unity.
1. What I've done so far -
1.1 Created a Firebase and Unity project
1.2 copied the json file into Assets folder
1.3 imported Firebase packages
1.4 downloaded jdk-8 and created JAVA_HOME variable
1.5 Created a c# script and put it into a gameobject (from the Firebase tutorial)
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
});
1.6 switched to Android environment and built with result "SUCCESSFUL" - with no errors whatsoever.
2. The issue -
2.1 I logged into my project on firebase and ran the code (from pc on Unity) and on my Android device, but firebase doesn't show any users connected :( (waiting for analytics).
2.2 Firebase
What am I doing wrong?
The app actually works! It just doesn't show connected users.
I went straight ahead and started logging data to the Real Time Data Base and it worked - data was added but it keeps saying "0 User Connections".
Is that a bug?
The first thing to do is double check that the task completed successfully. You can do this by saying:
FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
if (task.Exception != null) {
Debug.LogError($"Task failed with {task.Exception}");
}
else if (task.Result != DependencyStatus.Available) {
Debug.LogError($"Firebase dependencies not available with {task.Result}");
}
else {
Debug.Log("Everything's good!");
FirebaseAnalytics.SetAnalyticsCollectionEnabled(true);
}
});
You'll want some way to listen to these messages on device, and you can sometimes get the Unity Console to track those. But these days I like to install the Android Logcat plugin. You can find it in the Package Manager built into Unity:
It'll give you this cool window under Window/Analysis/Android Logcat:
And usually automatically hooks up to any game I run with the "Build & Run" button in Unity.
This will give you a ton of useful information about your game and perhaps shed a little more light on what's going on if you either hadn't been seeing the Unity logs or had been running adb logcat from the command line.
If you don't see any helpful logs there, there's a button in that logcat window called "Open Terminal". The claim is that it will open a terminal with adb in the $PATH so you can run android commands (in my own testing, the window appeared behind Unity, so I didn't think it was working. Then using which adb it still showed my system install of adb.).
With this open, follow the instructions for debugging analytics on Android. You'll want to type adb shell setprop debug.firebase.analytics.app <package_name> where <package_name> would be whatever your game's package name is (in my screenshot above, it's com.Firebase.PopsiclePlatformer).
Then you can open "Debug View" in the Firebase Console and see events in near real time:
I didn't include these steps in my video because it was difficult to embed both iOS and Android instructions in a timely manner, it should typically just work although Analytics doesn't guarantee realtime event reporting, and the focus wasn't on Analytics. I'm looking at making an updated thing just for Analytics, so I'm really curious if all of this helps you!
There are a couple of other things to check:
You might want to make sure you hooked up Google Analytics (this wasn't a thing when I recorded my video), but I don't think you could get the linked screenshot if you did.
You may also have to run "Force Resolve" from the External Dependency Manager, but that will be much more obvious if you have good logging going:
--Patrick
Related
I've created a Jetpack Compose app in Android Studio and I'm using Firebase services (Auth and Firestore). Everything works fine. I can access and create registers, but is a team project, so I uploaded all the project to Bitbucket, and my team cloned the repo.
When my team tried to login with the same user/password, the app keeps waiting and don't even create an error message in "Log" or "Run" window.
We already tried by adding the next line in AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
Also, we already sync build.gradle and check for versions of implementations (and that couldn't be the problem because is a cloned repo, so everything remains the same).
As a detail that I think it could be affecting this: the package name in manifest keeps the same. Is this wrong?
When run the app, this seems to be working fine, even throw this messages.
I/FirebaseApp: Device unlocked: initializing all Firebase APIs for app [DEFAULT]
I/FirebaseInitProvider: FirebaseApp initialization successful
And this is what I get from trying to do an auth operation
D/TrafficStats: tagSocket(98) with statsTag=0xffffffff, statsUid=-1
If you have experienced this problem, I would appreciate all the help I can get, thank you so much.
An error occurred in the transfer-and-conversion process, most likely. You wrote code, you compiled it, it ran well. Then, you transferred it to a repo, so if the transfer process was faulty (some file(s) didn't go to the repo / something underwent a partial transfer), it would break right away even if you run it on your own device by downloading from there. Now, if the transfer wasn't faulty, their conversion to an APK could be.
Debugging
To confirm where the problem lies, upload the code to the same bucket as you mention, then download the code again and compile in a fresh project. If it doesn't compile, transfer is faulty (or none of you know how to compile). If it compiles and runs as expected, their conversion/compilation is at fault and you've got nothing to worry about, except the fact that you have a team of useless drunks.
Solution
Should be obvious, if they can't make the end-product by themselves (those useless drunks), give it to them on a platter.
In Studio, go to "Build > Generate APK(s)". A confirmation dialog will have the link to the generated file once it's done. Share the apk directly with your "team" and see if it works. No need to see, it will work. Why do you have all the code if you are in a "team". Is it one of those teams where a single person does everything?
Need Help !!
We are getting caution message on top of the Dashboard in Firebase Crashlytics. We are tried with different technical advises in different forums.
But nothing has worked out for us. We are still seeing the caution message at the top (in red strip) and crashes count is incrementing on every crash but doesn't come to Dashboard.
Here we go with our Firebase Crashlytics integration with project :
We are using Firebase Crashlytics with Xamarin Forms project to record any crashes in Mobile Application.
Since, Firebase Crashlytics SDK & Documentation are mostly on Native Platforms (Android & iOS). But, we still got provision to get packages from NuGet.
Here is the checklist which ensures we are on right direction:
1) Is App released with proper Apple Distribution Provision Profile and Certificate- YES
2) Is Distribution Provision Profile valid in terms expiration date - YES, it is valid till Next year from now.
3) Is GoogleService-Info.plist correctly placed. YES- it was downloaded from Crashlytics console with proper identifier configured. File was placed at root of iOS Project and set Build Action as BundleResource.
4) Did we call required initialisation function at proper place. - YES. Below set of codes ensures we initialised properly Firebase Crashlytics in AppDelegate.cs class.
5) Is your build configuration rightly placed in Release mode. YES
6) Important Point: Firebase Crashlytics was able to process the reported crashes with earlier version of iOS build which were having same project and package configuration and we could able to see the Crashes in readable format till for immediate previous versions.
But suddenly it stopped working when we promoted to production in AppStore (means LIVE in AppStore)
7) Have we uploaded to dSYM file manually to Firebase Crashlytics - YES we TRIED. We followed the steps to upload dSYM using XCode-SWIFT project with POD files.
Here is the setup and step.
POD was installed in appropriate XCode workspaces.
Run Script was executed with recommended POD commands.
Build was succeeded.
Hence, as you see, we are practiced with every advises whichever mentioned in any forum. We have applied, but we don't see, it is coming to Crashlytics Dashboard even then.
Try below command. May be help full.
msbuild "/Users/xxx/projects/myApp/myApp/myApp.iOS/myApp.iOS.csproj" /t:"build" /p:Configuration="AppStore" /p:Platform="iPhone" /p:BuildIpa=true /p:FirebaseCrashlyticsUploadSymbolsEnabled=true
I have tried this command and it is working in my case. I get it from this git thread : https://github.com/xamarin/GoogleApisForiOSComponents/issues/386
I've been working on a game using Google VR in Unity3d and I recently updated my version of unity3d and the (built in) Google VR SDK to the latest version. After doing so the pre-launch report (automated testing on firebase) is showing crashes, during the unity splash screen, on 5 out of 6 devices.
This is the issue that is reported:
Issue: Crash of app uk.co.softkitty.puzzleroom running instrumentation ComponentInfo{com.google.android.apps.mtaas.crawler/android.support.test.runner.AndroidJUnitRunner}
Not very helpful, it looks like a generic unit test result if the app closes unexpectedly . I've looked through the logs and cant find anything unusual from my app or unity, but I did find something. It looks to me like this may be being caused by the test script itself:
10-27 01:54:54.494: I/ViewInteraction(19677): Performing 'single click' action on view (with class name: is "android.widget.ImageButton" and with id: uk.co.softkitty.puzzleroom:id/ui_back_button ...............
This to me, looks like the test runner is exploring the app UI and the first thing it does is click the "back" button. Which I would expect to close the app. I also tried using Firebase directly, which seemed to confirm it:
Firebase Activity Map
Does that seem likely that this is just a bug/red herring caused by changes to unity/GVR Or even firebase? Has anyone else experienced this?
I just don't want to release it if it really is crashing on so many devices!
Many Thanks
I asked Google Play Support about this and they got back to me.
They have confirmed that the issue is caused by a new crawler used by the Pre-Launch report. Details can be found here under the section "Pre-launch report versions"
They've escalated the issue and have also provided a workaround:
Sign in to your Play Console.
Select an app.
Select Release management > Pre-launch report > Settings.
In the “Pre-launch report version” section, move the Opt-out switch
to the right until it turns blue.
I haven't verified this yet but will mark as answer once I have.
Edit
I have tested this and all the tests pass again so this looks like a good solution for now.
We got this when uploading our APK as well. It started October 27th and crashed the following 4 days until we changed our setup. I couldn't see anything in our code base that should trigger this problem, so I wonder if it's related to changes on Google's side.
However, we did just did two changes and now everything's working again.
We added the following line to proguard-project.txt:
-keep class android.arch.** { *; }
I assume this was what fixed it.
At the same time we changed the compileSdkVersion and targetSdkVersion to 27 (and correspondingly all belonging support libs). For all I know they could have fixed it here too..
Edit:
To more directly answer your question: Yes, it does seem likely that this is just a bug/red herring, not on Unity's side, but in Firebase Test Lab or in Google's support lib. I tested the APK that failed the pre-launch tests and it worked just fine on my device.
I followed this link - https://developers.google.com/tag-manager/ios/v5/.
I can see my events in firebase console but not in google analytics.I defined my custom as well as default apple logevents.As it is also coming in my console "[Firebase/Analytics][I-ACS023024] No data to upload. Upload task will not be scheduled". I am using xcode 8.3.2 and swift3.Please help if anyone implemented.
There could be a few issues that can cause this. And more information is needed to find the cause, best place to look is the debug console in xCode.
GTM container is not setup correctly.
GTM Tags are not setup correctly.
The App/SDK checks for newer versions of the GTM container in 12 hour intervals. So if you did run the app for testing with a container with no tags, then added the tags to test for GA input, then the new container will not be used, until it gets the new container 12 or so hours later. (Work around for me was to uninstall the app from the simulator and run it again in xCode, just to be safe I clean the code too before running again. I did read somewhere that there was code to always check for newer containers, but I never got that to work)
Would be good if you can provide more information from the xCode debug console.
I'm writing this post because I don't know what I can do.
I'm developing an big app for iOS with a lot of users for my company; to log error and crashes I'm using Microsoft MobileCenter (Analytics and Crashed ver. 0.6), Xamarin.Forms ver. 2.3.3.168 and a lot of components such as Xam.Plugins, SQLite, PCLStorage, SharpZipLib.
As MobileCenter request the minimum target version for the app is 8.
Apart from minor bugs, the big problem is difficult to explain. I'm trying to ask you an advice.
The app is working fine. If I test it, I can't have any problems. At same point the app crashed for any apparently reason. No logs, no crashed, no nothing in MobileCenter. From this moment it's impossible to start the app and I can't have any logs about it: I can see the splash screen but after than the app is crashed again. It seems the problem raises after taking photo with camera.
When the app starts, it deletes images (if there are any in the folder), send a file to my server, and check with CrossDeviceInfo what the OS version is. Then the first page is called.
I tried to understand the problem to read the log in Xcode after connecting my device to my iMac but it's incomprehensible.
If I try to read the View Device Logs I can find one crash for my app but the log is still incomprehensible for me.
Then from Xcode I tried to open Organizer and under Crashes...
If I connect the device with this issue to my iMac and I deploy the app on it, the app is working fine. How can I understand where the problem is to fix it?
Update
In my App.xaml.cs I initialise MobileCenter like the following code:
public partial class App : Application
{
public App() {
// my code
}
protected override void OnStart()
{
MobileCenter.LogLevel = LogLevel.Verbose;
MobileCenter.Start(typeof(Analytics), typeof(Crashes));
}
}
It's Benjamin. I've already replied to you issues in our intercom but I wanted to reply to your issue here.
This scenario is not an actual crash but a kill of the app process by the operation system. The SDK runs as part of the app process and therefor can’t ever figure out that this kill even happened because the process is fully removed right away. Technically this is not a crash from an SDK perspective that it can detect and provide details for. Every single 3rd party SDK has this limitation and there is no way around it as Apple doesn’t provide the technical possibilities to do so.
In addition, none of your provided crash reports contain any reference to Mobile Center thus I can rule out our SDK is the cause of the kill.
I hope you find the cause for the issue.🖖