How to Solve tools:replace erorr in Xamarin.forms App - android

My Xamarin.Forms app when is in debug work perfectly fine, no errors also connect on my device and everything is ok. But when i change to Release|Any CPU and try to archive i get this 4 errors:
1tools:replace specified at line:15 for attribute android:icon, but no new value specified
2.D:\MyApp\MyApp.Android\obj\Release\100\AndroidManifest.xml:15:3-43:17 Error:
3. Validation failed
4.D:\MyApp\MyApp.Android\obj\Release\100\AndroidManifest.xml Error:
I don't what should make this problem .I have added : xmlns:tools="http://schemas.android.com/tools" and in <application> tag added this : tools:replace="android:label , android:icon"

I found it , for new android u must add android:icon="#mipmap/icon"

Related

Since update Xamarin.Android cannot build debug configuration without explicit manifest debug=true

I am in the process of upgrading a Xamarin Android application to SDK 31, monodroid 12 and the latest androidx packages.
Every thing is now up and running except if I do not add the android:debuggable=true attribute to the android manifest I can not create debug builds.
The issue does not happen for release builds
The output error is
Target _ManifestMerger:
/Library/Java/JavaVirtualMachines/microsoft-11.jdk/Contents/Home/bin/java -cp /Library/Frameworks/Xamarin.Android.framework/Libraries/xbuild/Xamarin/Android/manifestmerger.jar com.xamarin.manifestmerger.Main obj/Debug/android/manifestmerger.rsp
/Users/Projects/app/Droid/obj/Debug/AndroidManifest.xml:14:230-255 Error:
Attribute application#debuggable value=(true) from AndroidManifest.xml:14:230-255 is also present at AndroidManifest.xml:15:9-35 value=(false).
Suggestion: add 'tools:replace="android:debuggable"' to element at AndroidManifest.xml:14:3-56:17 to override.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(1489,3): error MSB6006: "java" exited with code 1.
Done building target "_ManifestMerger" in project "Droid.csproj" -- FAILED.
To get this working I currently have applied the following to the application node in the AndroidManifest.xml
tools:replace="android:debuggable" android:debuggable="true"
I would really like to figure out what this is and get it removed for obvious reasons before release.

Flutter When running app on Android a Manifest Merger failed error: different values is found

I am receiving the following error when I try to test my app on Android:
Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-36 value=(com.carbery.qiGangApp)
has a different value=(com.carbery.qiGangApp) declared in main manifest at AndroidManifest.xml:2:5-29
Suggestion: remove the overlay declaration at AndroidManifest.xml and place it in the build.gradle:
flavorName {
applicationId = "com.carbery.qiGangApp"
}
A little history, I did use another app as a template for starting this one and so I changed the name and the applicationId. Originally when running the app for Android I received the same error as above, but with the old name. I then did a Find through all my files and changed the old name to the new one. The correct name is: com.carbery.qiGangApp
However I am still receiving the error, now even though the two values it refers to, look to be the same correct ones.
As I come from an Ios back ground, I am not so familiar with the Android set up. So any help with solving this would really be gratefully received.
Many thanks
I was able to recreate your problem it seems that you need to sync your package name across multiple AndroidManifest.xml files.
Try to update this 3 AndroidManifest.xml files:

Unhandled promise rejection Android with React-native Error code: E_MISSING_PERMISSION

screenshot of error (same on device and emulator):
:
console.error: "Unhandled promise rejection", {"framesToPop":1,"code":"E_MISSING_PERMISSION","line":68885,"column":29."sourceURL":"http://10.0.2.2:8081/index.android.bundle?platform=android&dev=true&hot=false&minify=false"}
I have been developing with the iOS emulator, so launches fine with that, but now having troubles getting it to run on Android.
I have no idea what file is being referred to by the error so have no idea where to begin.
Solved it. One of the modules react-native-blur wasn't fully installed as android requires an extra step modifying the build.gradle file.
As seen here: https://github.com/dabit3/appsync-graphql-cities/issues/3
I fixed this by navigating to my AndroidManifest.xml file
android
-> app
-> src
-> main
-> AndroidManifest.xml
then add the line:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

android:targetPackage cannot resolve symbol

this might seem trivial but I can't understand why I'm getting this error.
I downloaded the sample app activityInstrumentation( from Android Studio File -> import Sample) and inside the testing project manifest I get an unresolved symbol for
android:targetPackage="com.example.android.activityinstrumentation".
After that I've created a manifest for my application and still there is an unresolved symbol on the attribute.
My application project dir and test project dir are:
app/src/main/java/com/example/appname
where manifest has
package="com.example.appname"
app/src/androidTest/java/com/example/appname
where manifest has
<manifest
...
package="com.example.appname.tests"
...
android:targetPackage="com.example.appname"
...
</manifest>
Please help me sort this out. I don't know what else I can do: using a sample app to create a full fledged test project was my very last hope.
You must specify android:targetPackage in instrumentation tag.
[http://developer.android.com/guide/topics/manifest/instrumentation-element.html
]
I see the same thing. Seems to be only false alert produced by the lint code inspection. When you run analysis (Analyze->Inspect code...) and open "Inspection" tab you can select the warning and mark it Suppress for tag. That will get rid of the warning.

Trouble adding Internet permission in Android Studio

When I added the following line to AndroidManifest.xml file
< uses-permission android:name = "android.permission.INTERNET" />
It shows two errors:
Error:The content of elements must consist of well-formed character data or markup.
Error:Cannot read packageName from C:\Users\Name\AndroidStudioProjects\Sunshine\app\src\main\AndroidManifest.xml
However, without That line of code, it compiles successfully and runs on my phone.
Here's my code:
http://pastebin.com/rnbsi0Yi
I have double checked the package name and everything else seems fine. What could be the problem?

Categories

Resources