When the Huawei APM SDK is integrated, there was no app performance data on the App performance management page. I wanted to locate the problem based on the Logcat logs on the device.
However, I'm not sure where these logs are kept or if I have to enable them in some way?
I checked the APM documentation and found out how to access the logs:
Open the AndroidManifest.xml file of the app, and add the meta-data element to the application.
<application>
<meta-data
android:name="apms_debug_log_enabled"
android:value=" true" />
</application>
After the APM debug log function is enabled, you can use the Logcat log filter function com.huawei.agc.apms or apms to view the logs.
Related
We are using GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context) to check for google services before showing a map. Even though the device has access to play services, the method is throwing an exception when being called. The exception is GooglePlayServicesIncorrectManifestValueException with the message:
“The meta-data tag in your app's AndroidManifest.xml does not have the right value.
Expected 12451000 but found 4323000. You must have the following declaration within the
<application> element:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />”
In the manifest I’ve declared:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
If I go into the play services version, I get:
<integer name="google_play_services_version">12451000</integer>
Which comes from
jetified-play-services-basement-18.1.0/res/values/values.xml
I’ve tried most solutions in other stack overflow posts to no avail. These are all the things I’ve tried and none of them work:
Change tag order in manifest (https://stackoverflow.com/a/37810158/8575762). This has no effect, and also it makes no sense that it should have one.
Make sure we are not providing our own hardcoded version (https://stackoverflow.com/a/63791222/8575762)
Remove the <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" /> tag from the manifest.
Update firebase libraries to latest BOM version (30.5.0)
Remove firebase libraries completely.
Update play services dependencies to latest version(auth, auth-api-phone, vision, wallet, location, safetynet)
Update google services plugin to latest version (4.3.13)
Add tools:node="replace" (also tried other manifest options like node:replace, etc) to the metadata tag & hardcode the version value
If I inspect the AndroidManifest on the built apk (debug), the value of the meta-data tag is the following:
<meta-data
android:name="com.google.android.gms.version"
android:value="#ref/0x7f0b000f" />”.
It’s important to note that this behavior is not 100% consistent. Usually I’ll do a fresh install and the first time I launch the app the isGooglePlayServicesAvailable method returns without crashing. If I restart the app it no longer works.
This seems like a bug in the services implementation library to me, but it feels like something too simple to be failing like that.
Any help would be appreciated, thanks in advance.
I added the package to my app putting the meta data with the API key and all that and it was working ok so I started working on other parts of my app and when I tried to use it again some time later it started giving me this exception:
Unhandled Exception: Platform Exception(error, java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml
its telling me to add the following to my AndroidManifest.xml:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
however i didn't need this line before and it was working just fine, why is it asking for it out of nowhere? I added it but now its crashing whenever it tries to load the map saying FATAL EXCEPTION: Thread-3. Can anyone help please?
It looks like you are using some kind of Google Mobile Services (GMS) APIs in your app. Google Maps API is one of them. As the error suggests, just add the meta-data to your AndroidManifest.xml to solve the problem. If you read the docs on how to properly set up Google Maps API or other GMS APIs in your app, you can find that you have to define the meta-data on AndroidManifest.xml as well.
Hope this helps.
I have a project which had crashlytics, fabric or whatever somewhere in the past. Now, when I'm trying to set it up once again and add this to manifest:
<meta-data
android:name="io.fabric.ApiKey"
android:value="my_key_which_came_from_previous_developer"
/>
I get the "CrashlyticsInitProvider skipping initialization" without any detailed description.
But if I remove the code above and add
<meta-data
android:name="my_key_which_came_from_previous_developer"
tools:node="remove"
/>
I get it somehow initialized BUT have the new problem -
I/System.out: [CDS][DNS]Unable to resolve host
"settings.crashlytics.com": No address associated with hostname
E/Fabric: Settings request failed.
So it either receives the settings or initializes the crashlytics. What do I do? Is there a way to completely remove and reinstall crashlytics for my application?
The problem was in proguard turned on and not properly configured to work with crashlytics. If the minifyEnabled option was set to "true" it wouldn't receive setting on the initial run. Nevertheless, it worked fine sending results if installed with proguard enabled.
We are doing the beta-test of our android app this time. Is there any way to stop android emulators from sending crash reports to the Firebase Console?
First we have to look at the devices of each problem to manually close them because we don't see if the problem comes from developing/testing or from a beta-tester.
Use this in your custom Application class onCreate method:
FirebaseCrash.setCrashCollectionEnabled(!BuildConfig.DEBUG);
If you compile the debug APK for emulators you are fine
You can add a meta-data entry to the AndroidManifest.xml for your app to disable Crash Reporting at build time.
<meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
Or you can disable by adding in Application or MainActivity,
FirebaseCrash.setCrashCollectionEnabled(false);
For more info check this link,
https://firebase.google.com/docs/crash/disable-sdk
When uploading an APK to the Android Developer Console, everything goes normal, but there are a certain subset of users on android 5.0 and up that are unable to install or upgrade the APK. These users see a Google Play Store error 505.
There are several different resources that tell you that the 505 error is a conflict of permission. Starting in Android Lollipop, you are no longer able to have duplicate custom permissions with the same name https://developer.android.com/about/versions/android-5.0-changes.html#custom_permissions. If you check stackoverflow for this error you'll find multiple reports of people offering this as a solution. While this can sometimes be the cause of this error there are several other reasons that this, and other conflicts can happen.
1. More than one app defines the same permission
If two completely different apps define the same permission e.g if you have a user and a manager app, and both of them have something along the lines of:
<permission
android:name="same.package.name.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
2. Same app signed by different keys
You have the same app, but signed by different keys. For example if you had a release version and a debug version, you'll hit a conflict because the system sees this as two different apps requesting the same permission.
3. Conflicting authorities
But there is an entirely different situation that can occur, which is less obvious. The 505 error can also occur with conflicting authorities. If two different apps declare the same provider, such as
<provider
android:name=".provider.YourProvider"
android:authorities="com.roqbot.client.YourProvider"
android:exported="false" />
This can also provide a conflict.
The last, and hardest conflict to spot, is one that can happen with Google Play Services 8.1 and up. If you do not define an application id in your build.gradle file like this:
defaultConfig {
applicationId "com.example.my.app"
}
it is possible that it will auto-generate a provider that can conflict with other apps. To check this, go into your your build>intermediates>manifests>full>release>AndroidManifest.xml and look for
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.google.android.gms.google_measurement_service"
android:exported="false" />
Here the authority name will conflict with other apps. If you add the applicationId to the default config, it will change this authority to
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.example.my.app.google_measurement_service"
android:exported="false" />
This is very subtle and appears to be a bug starting in google play services 8.1. The issue can be seen discussed here. https://code.google.com/p/android/issues/detail?id=189079&can=1&q=error%20505&sort=-opened&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened
The point to remember is that it may be several things, and the only thing you can verify for sure with a 505 error is that there is a conflict of some sort, and that it may or may not necessarily be a custom permission conflict.
If you are using the Facebook SDK and following the official sample code, you might also encounter the issue. In my case, I was using a same content provider name on 2 different app's manifest.
<provider
android:authorities="com.facebook.app.FacebookContentProvider123"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
I forgot to change the default name com.facebook.app.FacebookContentProvider123. Finally fixed it by adding a dynamic applicationId as provider name.
<provider
android:authorities="com.facebook.app.FacebookContentProvider.${applicationId}"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
Name Of The Error: Error 505
Problem: This is an unusual error code which is encountered during the updation or installation of the application from Google Play store. It shows up an error message stating “Unknown error code during Application installs 505”.
Following reasons are responsible for this error.
• It is mostly seen when you try to install an outdated version of the app.
• Error 505 can be caused due to the incompatibility of the app with your Android OS version.
• It can also arise due to cache conflict or data crash of the app.
• Error 505 may also arise due to Google Account Sync Problem.
Solution:
• At first restart your Android device, because this step usually works in getting rid off of any type of error. If it didn’t work and then try these simple steps.
• Clear Cache and Data of Google Play Store, Google Service Framework and Download Manager. To do this First of all go to Settings >> then Apps >> select All >> then Google Play Store and Clear cache and Clear data. Also Clear cache and Clear data for Google Services.