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.
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.
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.
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?
My logcat code:
http://txt.do/ku68
I tried solutions from other posts, but it is still not working.
[EDIT]
My manifest.xml:
http://txt.do/ku6e
Without posting the Manifest file one solution might be using the full path of your provider in authorities Tag in Manifest file:
<provider android:name=".MessagesForegroundProvider"
android:authorities="com.facebook.wakizashi.provider.MessagesForegroundProvider"