Flurry Analytics Integration Errors - android

After I successfully integrated flurry SDK into the library by using this code in my build.gradle file.
compile 'com.flurry.android:analytics:6.2.0'
I created java Class to integrate my API Key into my code, but I faced this probleme and I have no clue what should I do to successfully integrate it
-cannot resolve symbol FlurryAgent
-cannot resolve symbol flurrylistener
PS: I'm new to Flurry analytics and Android Studio

For now just remove the withListener() line.
It's not necessary to initialize Flurry.
Once you have your integration working, you can go back and set it up if you want, I've found it only to be necessary if you need to send events before Flurry completes initialization.

Flurry is working to get this corrected. Joel Duggan is correct the listener is "only necessary if you need to send events before Flurry completes initialization."
We will be removing this line of code from the basic instructions:
.withListener(flurryListener)
And here is the correct syntax for those who need it:
import com.flurry.android.FlurryAgentListener;
....
FlurryAgent.Builder()
.withLogEnabled(true)
.withListener(new FlurryAgentListener() {
#Override
public void onSessionStarted() {
// Session handling code
}
})
.build(this, 'your_api_key');

I was facing same problem, I have updated gradle and my problem is solved. Use latest gradle as follows,
//Flurry
compile 'com.flurry.android:analytics:7.0.0#aar'
for more reference use this url

Related

Google Play Services sign in not working well on Unity Android

I'm trying to add Google Play Services on my Unity Android project.
I've got already implement google play services plugin to my project. Filling the all crediantials. I've got 2 different internal test accounts on developer console.
Here is my question:
Account A: SignInStatus Success and not showing welcome pop-up
message.
Account B: SignInStatus Canceled and not sign in.
Is it because internal test or something?
unity version: 2019.4.16f1
gpgs plugin verison: 0.11.01
Here is my code:
referanced: https://github.com/playgameservices/play-games-plugin-for-unity
using GooglePlayGames;
private bool Authenticated;
public void Start() {
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status) {
if (status == SignInStatus.Success) {
// Continue with Play Games Services
Authenticated = true;
} else {
// Disable your integration with Play Games Services or show a login button
// to ask users to sign-in. Clicking it should call
// PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
Authenticated = false;
}
}
There is nothing wrong with your code.
I just created a new project, got a new SHA-1, added my account to the new google play console and verified that everything was tested successfully.
In doing so, we found the following problems:
If you are using the 11.01 version, please check if there is a problem by following the procedure below.
Follow the steps below to check.
(Assets → External Dependency Manager → Android Resolver → Force Resolve)
Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11: Repo path 'Packages/com.google.play.games/Editor/m2repository' does not exist.
If the above error occurs, you can solve it by choosing one of two solutions.
First, see comments by #greg-hanes here.
The specific method is to create a GooglePlayGamesPluginDependencies.xml file inside the Assets/GooglePlayGames/com.google.play.games/Editor/m2repository folder and paste the following contents.
<?xml version="1.0" encoding="UTF-8" ?>
<dependencies>
<!-- Internal library dependency generated at build time.
It also defines the transitive dependencies on play-services
-->
<androidPackages>
<androidPackage spec="com.google.games:gpgs-plugin-support:0.11.01">
<repositories>
<repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
</repositories>
</androidPackage>
</androidPackages>
</dependencies>
And then Force Resolve again.
(Gradle failed to fetch dependencies on the way. If you get an error, make sure your JDK path is set correctly.)
Second, downgrade the version to version 10.14.
Here is my code that I wrote to run only once at runtime. It works successfully when I run it.
using UnityEngine;
using GooglePlayGames;
using GooglePlayGames.BasicApi;
public static class Login
{
[RuntimeInitializeOnLoadMethod]
public static void SignIn()
{
PlayGamesPlatform.Instance.Authenticate(success =>
{
Debug.Log(success ? "Success Login" : "Failed Login");
});
}
}
You can check the logs on Android by installing the Android Logcat package.
I hate the 11.01 version so I'm using the 10.14 version :)
Hope your problem is solved!

Crashlytics on Android - what to import?

ATM I have an application in the field with a working, basic Crashlytics support - I can see the crashes coming in my Firebase console.
Now, I'd like to add some custom info to the stacktraces coming. Crashlytics docs state that I can add custom 'keys' in the following way:
Crashlytics.setString(key, "foo" /* string value */);
They however fail to mention what do I have to import here for the compiler to resolve the 'Crashlytics' symbol? Googling doesn't help....
Well, it turned out that Crashlytics's own docs are not up-to-date. Even though this official page clearly says to do
Crashlytics.setString(key, "foo" /* string value */);
and then iike Oleg says the right import would be
com.crashlytics.android.Crashlytics
but earlier on the same Crashlytics docs page advises to add the following dependency
// Add the Firebase Crashlytics dependency.
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta04'
where com.crashlytics.android.Crashlytics doesn't exist.
Correct (at least at the moment, Crashlytics seems to be changing in non-compatible ways) way seems to be include the dependancy in 'build.gradle' as given above and then
import com.google.firebase.crashlytics.FirebaseCrashlytics;
(...)
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
crashlytics.setCustomKey("key", "value" );
That should be resolved by this import statement
import com.crashlytics.android.Crashlytics;

How can I import firebase in-app-messaging-display api's source code into my android project?

I am trying to customize the firebase in-app-messaging-display's UI of "Image Only" and "Modal" mode. So I turned to the official documentation, but it is quite simple, by saying:
Creating your own display is a two step process:
1.Write your own implementation of the FirebaseInAppMessagingDisplay class.
2.Register that implemenation with the headless Firebase In-App Messaging SDK.
I wonder how can I import in-app-messaging-display's source code into my project and make it work as a library.
I have downloaded its source code from github:https://github.com/firebase/firebase-android-sdk/tree/master/firebase-inappmessaging-display, tried to import it as a module, but after I selected the Source directory, Android Studio hints that: Specify location of the Gradle
or Android Eclipse project. I also have tried to copy the source code into my project's libs directory and added this: include ':libs:firebase-inappmessaging-display' into my settings.gradle file and this: implementation project(':libs:firebase-inappmessaging-display') into my app's gradle dependency. When sync building Android Studio reports errors like this:
ERROR: Unable to resolve dependency for ':XXXXXXXX': Could not resolve project :libs:firebase-inappmessaging-display.
Any suggestion will be highly appreciated.
The information on the doc is little bit confusing. I am also stuck with the same problem for long time. Actually its very simple.
Add these dependencies in your app level gradle file.
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation ("com.google.firebase:firebase-inappmessaging:17.0.3")
Register Your DisplayMessage component on starting activity.
import com.google.firebase.inappmessaging.FirebaseInAppMessaging
import com.google.firebase.inappmessaging.FirebaseInAppMessagingDisplay
///////
override fun onStart() {
super.onStart()
Log.e("MESSAGE", "activity started")
var firebaseInAppMessagingDisplay = FirebaseInAppMessagingDisplay { inAppMessage, cb ->
// You can show the message here.
// The variable inAppMessage has all information about the campaign that we putting in console (title, content, image url.. etc)
Log.e("MESSAGE", "Display Message callback invoked")
}
FirebaseInAppMessaging.getInstance().setMessageDisplayComponent(firebaseInAppMessagingDisplay)
}

firebase Instance ID vs android Instance ID

Play services API suggests that there is something called Instance ID
However, after including the following in Android Studio, I am unable to import InstanceID class
compile "com.google.android.gms:play-services-identity:${googlePlayServicesVersion}"
compile "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}"
Per this SO Post, InstanceID class should work if I include the identity play services library.
Following conversion of google cloud messaging to firebase cloud messaging, I believe, it must have been replaced by Firebase Instance ID as mentioned in the red message here.
Now I am not sure if using Firebase ID should have indeed "replaced" Instance ID.
Or, maybe I am missing some library which includes InstanceID?
Yap,
I had the issue, and finally I realize that InstanceID class is a part of 'com.google.android.gms:play-services-iid' library , so you just have to add this line in your gradle build file:
compile "com.google.android.gms:play-services-iid:${googlePlayServicesVersion}"
Unless this works for me :) ...

App-Auth Android Example Error in AuthState constructor

I am using the example for AppAuth-Android from this github repository
The gradle configuration I am using is
compile 'net.openid:appauth:0.5.1'
The error thrown is for the lines below:
AuthorizationServiceConfiguration config = new AuthorizationServiceConfiguration(
mConfiguration.getAuthEndpointUri(),
mConfiguration.getTokenEndpointUri(),
mConfiguration.getRegistrationEndpointUri());
mAuthStateManager.replace(new AuthState(config));
The error states that AuthState(AuthorizationServiceConfiguration) constructor not defined.
Is the example not updated for the library version or is there any other error.
Lead maintainer of AppAuth here - I believe I added that method after the release of 0.5.1, you'll need to wait for the 0.6.0 release to use it.

Categories

Resources