React native application. Despite having entered in the manifest android:exported="true" i still have this problem in the build phase. It almost seems that some installed plugins did not insert it.
I read in some posts that proposed as a temporary solution to downgrade to version 30 of the android SDK, but i cannot because with that version it does not allow me to compile.
React Native 0.68
Android SDK version 33
Android Gradle Plugin version 7.3.0
From Merged Manifest
Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 26 Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. mobile_app.app debug manifest, line 33
Based on the response from Aleja Duque-Torres, here's a temporary solution by adding the following code segment to your AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...your package name"
xmlns:tools="http://schemas.android.com/tools"> <!-- ADD THIS LINE -->
<!-- Other Content -->
<application
.../>
<!-- ADD STARTS HERE -->
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false"
tools:replace="android:exported"/>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false"
tools:replace="android:exported"/>
<!-- ADD ENDS HERE -->
</application>
</manifest>
Then do a build folder clean and run the project again. Hope this helps!
P.s. my guess is that this problem is due to some dependency package getting messed up. If someone else has any insight please feel free to shed some light on it!
solution:
In Git-bash run: * ./gradlew assembleDebug --stacktrace --info | tee my-logs.txt
Search "InstrumentationActivityInvoker"
Open file and add android:exported="true" on activity
Same issue, But I can't know the reason for it. It happens when I have updated macos, Do you have any information?
Related
I am building APK for android in React Native CLI but during the building process. I am getting errors:
Execution failed for task ':app:processBugsnagE2eFossReleaseManifest'.
Bugsnag: Your AndroidManifest.xml is missing one or more of
apiKey/versionCode/buildUuid/versionName/package, which are required to upload to bugsnag.
apiKey=null
versionCode=999999999
buildUUID=beab08fe-8a94-4edf-bb62-ff84eef7bd8f
versionName=4.24.0
applicationId=botx7.Chat
Anyone please guide
https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/3422#issuecomment-957513622
android/app/src/main/AndroidManifest.xml
....
<meta-data android:name="com.bugsnag.android.API_KEY" android:value="${BugsnagAPIKey}" />
</application>
I am running React-Native 0.63.4 and encountering the following error:
Execution failed for task ':app:generateDebugBuildConfig'.
> Failed to calculate the value of task ':app:generateDebugBuildConfig' property 'buildConfigPackageName'.
> Failed to query the value of property 'packageName'.
> java.lang.NumberFormatException: For input string: "1.0.0"
This occurs when running npm run android, shortly after Gradle is done configuring the app and tries to execute it.
This error occurs both when I run the command from the root folder of the project as well as from the /android/ subfolder.
I did a gradlew clean but it is not helping.
Edit:
If I go in my /android/ folder and run gradlew android, the build will complete without error.
It is only when I run npm run android that this error shows up.
Here's another solution:
It's possible the xmls:tools is missing from android/app/src/main/AndroidManifest.xml folder. So you'll need to add that back.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.<buildname>">
This should be the first line at the top of your Manifest.xml.
I finally figured it out.
on the file: android/app/src/main/AndroidManifest.xml
The content began by:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyBusiness.MyApp"
android:versionCode="1.0.0"
android:versionName="1.0.0">
The versionCode has to be an integer: Only digits allowed. Apparently it does not matter what it is as it will increment whatever number we put.
Changing this to a number solved my problem:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MyBusiness.MyApp"
android:versionCode="1000"
android:versionName="1.0.0">
I have a UIAutomator test that interacts with the OS to automate some tasks that I can't do from ADB or another app. Sometimes I release a new version of the tests. I planned on using adb shell dumpsys package my.package.test | grep versionName to parse the version from the test app, and update it if necessary.
However, it appears that dumpsys package returns versionName=null for my UIAutomator test (built using a gradle script near-identical to the sample).
Right now I'm just overwriting the test every time I need it. Is there some way to embed version information in a UIAutomator test APK?
There's no version information in the default manifest generated for the test APK, then you have to introduce it.
1.
add this to your build.gradle:
defaultConfig {
manifestPlaceholders = [ versionName:versionName, versionCode:versionCode]
}
2.
copy your main AndroidManifest.xml to src/androidTest
3.
edit the test manifest
<!--suppress AndroidDomInspection -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="your.package.name"
android:versionCode="${versionCode}"
android:versionName="${versionName}"
>
<application
tools:node="remove"
... >
</application>
</manifest>
4.
Once rebuilt, your test APK will include version information.
According to https://developer.android.com/training/wearables/watch-faces/service.html, I need the two privileges shown here from my manifest file:
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="com.google.android.permission.PROVIDE_BACKGROUND" />
<!-- So we can keep the screen on and start vibrations -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
However, starting recently (perhaps since I upgraded my watch to 6.0?) I see the following in the log:
06-07 12:14:24.609 470-493/? W/PackageManager: Unknown permission com.google.android.permission.PROVIDE_BACKGROUND in package com.pipperpublishing.refwatch
I've Googled for any changes in the permission model, perhaps associated with the new model in 6.0, but can't find anything about this.
Any thoughts?
UPDATE: Looking at https://developer.android.com/reference/android/Manifest.permission.html it's clear that PROVIDE_BACKGROUND is no longer there, but I can't find anything that says it's been replaced or why it's no longer needed.
I relayed this question over to the Wear development community on G+, and according to a Google dev advocate there, this permission was never actually used - and is safe to remove from your manifests.
Reference: https://plus.google.com/+SterlingUdell/posts/hvec9y93Gtf
Though I delete the "{}" braces but it still occurs.
<provider
android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider{facebook_app_id}"
android:exported="true" />
The format shoud be: android:authorities="com.facebook.app.FacebookContentProvider0123456789" , where 012345678 is your Facebook app ID. Use it without the { character. So your provider tag should be:
<provider
android:authorities="com.facebook.app.FacebookContentProvider0123456789"
android:name="com.facebook.FacebookContentProvider"
android:exported="true"/>
However, if you accidently have already used the { character, then you will be most likely facing an Android Studio bug as it is reported here. The problem is that you are trying to edit the wrong manifest. The poped up manifest from Android Studio build message is not the application's manifest.
So simply open your application's manifest and you can edit it without problem.
I had the same: the IDE re-inserted the curly braces. I cut the part, restarted Android Studio and pasted it. Then it worked.
Replace {facebook_app_id} in the snippet you posted with your Facebook app id.
You added the <provider../> tag in the wrong place
Delete the <provider../> tag
Close Android Manifest
Try "Sync Project with Grandle Files"
Build Project again
Open Android Manifest
Add the tag, without hte brackets '{}' right before application tag closes
...
<provider
android:name="com.facebook.FacebookContentProvider"
android:authorities="com.facebook.app.FacebookContentProvider7779..."
android:exported="true" />
</application>
Hope it helps