Debugging application gives me a red line - android

On Manifest, I get an error for Debugging
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:debuggable="false">
I am trying click for apk in Android tools >> Export signed Application Package" but I don't know how I got an error.
The Lint Warning for it "Avoid hardcoding the debug mode; leaving it out allows debug and release builds to automatically assign one"
Can anyone help?

When you Create the Signed .APK / (release .APK) means, you must remove the android:debuggable="false" it is only for debugging purpose not for release.
change this
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:debuggable="false">
Into like this
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">

Remove
android:debuggable="false"
The error is telling you not to hard code it (omit it) and it will assign the value itself depending on what you are doing. If you tell AS to debug, it will set it to debug. If you export your apk it will set it to false.

Related

APK isn't installed even though I use generated Signed APK

I think there's some update for blocking the installation of APK from outside. Normally, I used to install apks with generated signed apk. But, recently It doesn't work at all. I deleted the app properly, So, it has no issue with the previous app. Everything is checked and filled up.
Is there is changes with Android OS?
I was using demo app provided by third party company.
And the problem was an attribute of manafiests.xml
It was like this:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:testOnly="true"
android:theme="#style/AppTheme">
And the solution was deletng testOnly attribute of application tag like this:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
What testOnly does is when it's enabled it can only be installed by adb and not able to publish on Google Play.
So, it was not Android OS version problem.
For more information: https://developer.android.com/guide/topics/manifest/application-element

Error compiling after AndroidX installation

I recently installed the AndroidX libraries. My problem now:
Didn't find class "androidx.core.app.CoreComponentFactory"
I get an error message. My Mobile App closes after opening screen.
Have you tried this?
Go to Manifest, then add inside the application.
<application
android:allowBackup="true"
android:appComponentFactory="anystrings be placeholder"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:appComponentFactory">
Perhaps this is one of the reasons!

android manifest merger cannot merge three manifest files

i have 2 versions of AndroidManifest.xml files in my project, one is the main and another for debug.
in both of them i have android:label and in the debug version i have tools:replace="label"
after adding a library through gradle i suddenly see:
Error:Execution failed for task ':app:processMobileDebugManifest'.
Manifest merger failed : Attribute application#label value=(XXXX Debug) from AndroidManifest.xml:36:13-45
is also present at [library_name] AndroidManifest.xml:13:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:7:5-20:19 to override.
it already exists there! what am i doing wrong?
Edit1:
main xml:
<application
android:name="[package_name]"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
debug xml:
<application
tools:replace="name, label"
android:name="[package_name]"
android:label="[debug_name]">
third party library xml:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
I found out that the label should have the same value like all others.
Meaning that tools:replace works only if all labels looks like this:
android:label="#string/app_name"
In my case it didn't work because in the debug manifest it looked like this:
android:label="debug name"
But once i changed it to android:label="#string/app_name" and added string in the debug/values dir it started working correctly.
Seems like a bug in Android Studio.

Android Google Analytics - adding to which xml?

I was instructed to add the following to some file but not sure which one, please help me.
Mark application entry – Manifest
Add Analytics as application name on Manifest entry as below :
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".Analytics">
but my current project manifest already have the following:
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
What should it become now?
This means you have Analytics application class in your app
android:name=".Analytics"
will consider as your application base class.
for more info please refer this link http://developer.android.com/reference/android/app/Application.html
Assuming you are using SDK v4, use the link
The documentation is very straight forward so you shouldn't have any issues integrating it.

Modfiying Android Manifest

So I have been following a tutorial titled 31 days of Android. I am having an issue with one of the tutorials. It calls for me to modify the androidmanifest.xml file but when I do but it doesn't work. Everytime I run the application it crushes after I press button 2. Here is the code they wanted me to add
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="MyApplication">
and here is the code looks after I have added that code to my file.
<application android:icon="#drawable/icon" android:label="#string/app_name" android:name="MyApplication">
I did not add the android:icon="#drawable/ic_launcher" because it gave me an error which read "no resoucre found that matches the given name". Any help would be appreciated.
The error is because there is no icon in your project,
Look in Project/res/drawable/ ...
The ic_launcher is the default icon, so just replace
android:icon="#drawable/icon"
By :
android:icon="#drawable/ic_launcher"

Categories

Resources