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?
Related
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:
Strange problem with Manifest Merger, Visual Studio Mac, Xamarin Forms (5.0.0.2125), Android project, SDK 29 to 30. Problem initiated from an extra ">" in the Properties/AndroidManifest.xml file. That generated the error below, indicating the xml structure wasn't closed; line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 11; XML document structures must start and end within the same entity. (AMM0000)
So, I edited out the extra character, and the obj/debug/AndroidManifest.xml is created and looks right, however, the build error remains the same!
Subsequent complete rewrites and edits of the Properties/AndroidManifest.xml file have only 2 outcomes
Entering an erroneous xml format will generate the appropriate errors describing the error.
Entering a correct xml format, with any combination of entries, lines and characters will generate a correct obj/debug/AndroidManifest.xml file with the the correct Properties/AndroidManifest.xml content. However, the original build errors stay, with the " line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml." error.
So, something cached, somewhere, but no clue where. Started during an aborted simulator build and has been here ever since.
Have tried quite few things including:
cleaning, rebuilding and many combinations
remove obj and bin
removing/adding declarations in the AndroidManifest.xml
using different AndroidManifest.xml files
deleting AndroidManifest.xml and running
restoring from cloud a different version of solutions
commenting out Activity declaration on MainActivity
reinstall of VS for Mac
I think it is similar to this bug
Xamarin android Manifest being replaced on build. only solution seems to be to repair visual studio
Has anyone seen this type of bug before?
Help much appreciated as have run out of ideas here.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="17" android:versionName="1.17" package="com.mycompany.myapp">
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30" />
<application android:label="myapp" android:icon="#mipmap/ic_launcher" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
Solved here, github.com/xamarin/xamarin-android/issues/6385. Was a problem in a Nuget Firebase library AndroidManifest.xml file. Unfortunately the error reporting in VS Mac Manifest merging doesn't report which of the 140+ AndroidManifest.xml files has the problem. However, with a bit of sleuthing, there is a way to eventually work it out.
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"
I'm trying to build a ROM for my phone (Xiaomi Mi A2 Lite) with SELinux enforcing. I've booted the phone successfully in permissive mode, however in the enforcing mode the Wi-fi won't work and SystemUI restarts every few minutes, displaying "Phone is starting..." instead of the launcher screen.
I used audit2allow to grab SELinux denials from my phone and added the output to the list of SELinux policies. However, when I try to compile the ROM, I get the following error:
device/xiaomi/daisy/sepolicy/daisy.te:224:ERROR 'unknown type qemu_hw_mainkeys_prop' at token ';' on line 75538:
allow platform_app qemu_hw_mainkeys_prop:file read;
After getting that error, I declared the type in my property.te file:
type qemu_hw_mainkeys_prop, property_type;
And after trying to compile the ROM again I get this:
device/xiaomi/daisy/sepolicy/property.te:3:ERROR 'Duplicate declaration of type' at token ';' on line 75576:
type qemu_hw_mainkeys_prop, property_type;
DT: https://github.com/tkchn/android_device_xiaomi_daisy/
Android will append all te files to one file. You need to add a blank line at the end of each te file, otherwise the last line of previous file and first line of current file will be mixed. And also, I prefer that you also add a blank line at the beginning of each te file to avoid format error from other te files.
I am trying to dexguard an application that I run as a system application.
However when I try to push it to the system/app directory, I get the following error from the PackageParser.
W/PackageParser( 1995): /system/app/My.apk (at Binary XML file line #290): <a
ctivity> does not have valid android:name
I have also added the following to the dexguard-project.txt but to no avail.
-keepresourcexmlattributenames
manifest/installLocation,
manifest/versionCode,
manifest/package,
manifest/versionName,
manifest/application/*/intent-filter/*/name,
manifest/application/*/activity/name
Does anyone know how to solve this issue?
UPDATE
Ok from what I see the manifest/application/*/activity/name successfully stopped the android:name attributes from being obfuscated in the manifest (I can see the plain text when I extract the manifest file after the obfuscation).
However strangely enough android:name in the activity tag at line #290 cannot be found in the extracted manifest file. All the other activity names can be seen in plain text.
In my case the package name of the class started with a Capital letter
I found out that this is because the activities that gave this error are in the manifest file but there were no respective java classes.
Removing the entries from manifest file solved the issue.