New relic plugin on Eclipse Android - android

So I'm on a Mac with Eclipse and I'm trying to add the new relic plugin. I've already followed the instructions up to import.
import com.newrelic.agent.android.NewRelic;
But now when I try to add the code:
NewRelic.withApplicationToken(mycode).start(this.getApplication());
where mycode is just the id as String given to me by new relic. I get an error that says:
Syntax error on token "withApplicationToken", = expected after this token
Any ideas?

I think there might be some error in where this line was added or how the token was formatted.
Here's the exact formatting for this code, in its context:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NewRelic.withApplicationToken(
"AA9b032a80e2658208a0180ec09ff1f059badb7756"
).start(this.getApplication());
setContentView(R.layout.lookup);
That's just a demo token, I've altered some characters in my token so that you won't start sending to my dashboard :)
If that doesn't fix it, I would send a complete code snippet to New Relic in a support ticket, either under 'help' in your dashboard or at support#newrelic.com.
If you do open a ticket and there's a general solution, I'll come back here and post the right steps for other users.

This line looks fine. Is there a missing semicolon or something in the previous line? Can you verify that?

Related

Spotify Authentication auth_service_unavailable

I am trying to login to spotify.
Although when the app is installed it always throws an AUTHENTICATION_SERVICE_UNAVAILABLE error. If the app is uninstalled the default Webview opens where the login works fine. Wished behaviour is, that the app opens and the user can login from there.
public void doSpotifyLogin(boolean trySpotifyAgain) {
this.trySpotifyAgain = trySpotifyAgain;
AuthorizationRequest.Builder builder =
new AuthorizationRequest.Builder(CLIENT_ID, AuthorizationResponse.Type.TOKEN, REDIRECT_URI);
builder.setScopes(new String[]{"user-read-private", "streaming", "playlist-read-private", "user-library-read"});
AuthorizationRequest request = builder.build();
AuthorizationClient.openLoginActivity(this, SPOTIFY_LOGIN_REQUEST_CODE, request);
}
This is the response I am getting from the API:
2021-12-22 11:36:29.802 5069-5069/? I/com.spotify.sdk.android.auth.LoginActivity: Spotify auth completing. The response is in EXTRA with key 'response'
2021-12-22 11:36:29.822 5069-5069/? D/StartActivity: Spotify error: AUTHENTICATION_SERVICE_UNAVAILABLE
If you need any further information, please let me know! Thanks in advance
Ronze's comment worked for me. I needed to update my app's package name on developer.spotify.com.
For me, the issue got resolved after I added the SHA1 key generated on a new mac to the Spotify app dashboard

Android - ConsentInformation - Could not parse Event FE preflight response

I ve seen this error posted in many places but no one has ever answered what needs to be done to fix it or why is it happening. I m hoping I ll have better luck.
ConsentInformation consentInformation = ConsentInformation.getInstance(getActivity());
String[] publisherIds = {"pub-**********~*******"};
consentInformation.requestConsentInfoUpdate(publisherIds, new ConsentInfoUpdateListener() {
#Override
public void onConsentInfoUpdated(com.google.ads.consent.ConsentStatus consentStatus) {
//do something
}
#Override
public void onFailedToUpdateConsentInfo(String errorDescription) {
Log.e("GDPR ", errorDescription);
}
});
This is how I am using the consent sdk. I always get the same error: Could not parse Event FE preflight response
My import in gradle is implementation 'com.google.android.ads.consent:consent-library:1.0.6'
I am running this code on the OnCreateView method of the first fragment loaded. Also tried running a few seconds later in case it was a timing thing...still the same error.
Also tried adding the ca-app- prefix before the pub in publisher id...same result.
Any help is appreciated.
Make sure that you're using Publisher ID and not App ID
Publisher ID is the unique identifier for your AdMob account.
Looks something like this pub-7100389293873601
App ID is the unique ID assigned to your app. It looks something like this ca-app-pub-7100382293173983~6849306728.
You can have multiple App IDs (for each app) but you can only have one Publisher ID for your account.
You can find your publisher ID in you AdMob Settings:
Or make sure you pasted it correctly.
Hope this helps!
The Admob account I used was completely new and the "Could not parse Event FE preflight response" was displayed repeatedly. Only when I tried it with an older account it worked. I think you have to wait a bit for verification.
or
Another thing to try is add your payment information to your Admob account
like described in this answer https://stackoverflow.com/a/61423243/8779275 and also check the other points there.

PayPal Here Android SDK Error - BadConfiguration: Cannot proceed with this merchant account

I'm trying to integrate the PayPal Here swipers into a Xamarin Android app. Everything is fine until I try and give my credentials to the SDK. Specifically, the line containing the call to PayPalHereSDK.SetCredentials
public void InitializeSdk( Context context, string serverName, string accessToken, string refreshUrl, string expires, IPayPalHereSdkWrapperCallback listener ) {
PayPalHereSDK.Init( context, serverName );
PayPalHereSDK.RegisterAuthenticationListener( this );
PayPalHereSDK.CardReaderManager.RegisterCardReaderConnectionListener( this );
if ( !string.IsNullOrEmpty( accessToken ) ) {
var credentials = new OAuthCredentials( accessToken, refreshUrl, expires );
PayPalHereSDK.SetCredentials( credentials, new SetAccessTokenResponseHandler( listener ) );
}
}
My SetAccessTokenResponseHandler class implements the Com.PayPal.Merchant.Sdk.Domain.IDefaultResponseHandler interface. As described above, the OnError function is called when call the PayPalHereSDK.SetCredentials function. I'm given the error code "BadConfiguration" and the message "Cannot proceed with this merchant account. ready"
I've searched Google high and low and, I believe, scoured SO pretty thoroughly. I can't seem to overcome the error, so I'm asking for help!
I think the paypal email is not verified properly. Please go through the merchant onboarding guide document to get more details regarding making the merchant eligible.
https://github.com/paypal/paypal-here-sdk-android-distribution/blob/master/docs/Merchant%20Onboarding%20Guide.pdf
Hope this helps. Cheers.
I'm not sure what exactly the issue was, but I ended up deleting the Sandbox App in my PayPal dev portal and creating a new one. Everything works now. head scratch
I resorted to this because, while trying to follow Sundar's suggestion, I started getting an "invalid scope" error. I had received them before and KNEW I had it fixed ( and no code had changed ). When I deleted/recreated the app, that error went away. Frustrating, but that's what worked!

Android switch from Parse to Parse Server crashes

I'm migrating my Android and iOS app from Parse.com to Parse Server. First I'm doing this migration with a test app to be sure everything is ok.
With iOS there has been no problem but with Android the updated app crashes each time the user enters in the app.
This is the Android code updated:
public static void initParse(Application app) {
ctxt = app.getApplicationContext();
Parse.enableLocalDatastore(app);
// Old version
//Parse.initialize(app, "<my app id>", "<my client key>");
// New version
Parse.initialize(new Parse.Configuration.Builder(ctxt)
.applicationId("<my app id>")
.clientKey(null)
.server("https://<my new server>/parse/")
.build()
);
ParseUser.enableRevocableSessionInBackground();
}
The crash returns a "com.parse.ParseException: java.lang.IllegalStateException: unable to encode an association with an unsaved ParseObject", and taking into account what I've read in Stackoverflow, this is because ParseUser.getCurrentUser() returns null (despite the user is logged in) and Parse methods fail.
In fact, if I take this same code, uncomment the old version of Parse.initialize, comment the new version of Parse.initialize, compile and launch the app, this is launched without problems and the user can use it properly.
But again, if I comment the old version of Parse.initialize, uncomment the new version of Parse.initialize, compile and launch the app, this crashes inmediately because ParseUser.getCurrentUser() returns null and Parse methods fail.
What am I missing here? Should I force my users to login again? This seems to me a bad UX, and anyway, in iOS I have no problems with the new version, what is the difference between both platforms?
EDIT 1:
Following Robert Rowntree advice I've changed the initialization to this:
public static void initParse(Application app) {
ctxt = app.getApplicationContext();
Parse.enableLocalDatastore(app);
// Old version
//Parse.initialize(app, "<my app id>", "<my client key>");
// New version
Parse.initialize(new Parse.Configuration.Builder(ctxt)
.applicationId("<my app id>")
.clientKey("<my client key>")
.server("https://<my new server>/parse/")
.build()
);
//Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
ParseUser.enableRevocableSessionInBackground();
}
Besides this I've checked that my Parse version is the last available, I have this in my gradle file:
compile 'com.parse.bolts:bolts-android:1.+'
compile 'com.parse:parse-android:1.+'
And the result is the same, the app crashes with "com.parse.ParseException: java.lang.IllegalStateException: unable to encode an association with an unsaved ParseObject" the first call I make to Parse.
Besides this, the unique log I can see related to parse is one related to GCM token, nothing else.
EDIT 2:
I've tried another thing, uninstall the app with the old initialization and install it with the new initialization and as I guessed the new version is now working.
But, of course this is not a solution to me, I can not tell my users to uninstall the app ans install it again.
But this is a hint: there is no problem with the new initialization but with how the old Parse "reacts" when opening the app with the new Parse Server, there must be any inconsistency in getCurrentUser or something like that.
Can you try initializing like this:
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId("APP_ID")
.clientKey("CLIENT_KEY")
.server("https://SERVER_URL/parse/") // The trailing slash is important.
.enableLocalDataStore()
.build()
);
notice the
.enableLocalDataStore()
is in the initilization. Remove this:
Parse.enableLocalDatastore(app);

Google Spreadsheet API - Java - com.google.gdata.util.ParseException: Unrecognized content type:application/binary

I am using Google Spreadsheet API in my simple Android application. This is the piece of code:
URL spreadSheetUrl = new URL("https://spreadsheets.google.com/feeds/spreadsheets/private/full");
SpreadsheetQuery query = new SpreadsheetQuery(spreadSheetUrl);
query.setTitleQuery("xyz");
query.setTitleExact(true);
SpreadsheetFeed spreadSheetFeed = service.getFeed(query, SpreadsheetFeed.class);
This piece of code is called from my application's sync adapter.
I am getting this error:
com.google.gdata.util.ParseException: Unrecognized content type:application/binary
com.google.gdata.client.Service.parseResponseData(Service.java:2136)
com.google.gdata.client.Service.parseResponseData(Service.java:2098)
com.google.gdata.client.Service.getFeed(Service.java:1136)
com.google.gdata.client.Service.getFeed(Service.java:1077)
com.google.gdata.client.GoogleService.getFeed(GoogleService.java:676)
com.google.gdata.client.Service.getFeed(Service.java:1034)
Can someone suggest how I can solve this issue?
It turns out that I did not set the user credentials before executing this piece of code.
service.setUserCredentials(user, password);
Adding this line helped solve this issue. Weird.

Categories

Resources