Reputation: 5464
I'm getting a gradle error at building since yesterday - it just came randomly....
Full stacktrace here:
My project depends on multiple libraries and it built without any problems until yesterday (even with the librarys)
compile 'com.google.android.gms:play-services:3.1.36'
compile 'com.android.support:support-v4:13.0.0'
compile project(":libs:DatabaseCreationHelper")
compile project(":libs:actionbarsherlock")
Anyone has an idea how to fix it? it just randomly came... Full stacktrace here:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':ItchyFeet:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter$1.run(CacheLockReleasingTaskExecuter.java:35)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:179)
at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:232)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.longRunningOperation(DefaultPersistentDirectoryStore.java:142)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.longRunningOperation(DefaultTaskArtifactStateCacheAccess.java:83)
at org.gradle.api.internal.changedetection.state.CacheLockReleasingTaskExecuter.execute(CacheLockReleasingTaskExecuter.java:33)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.ContextualisingTaskExecuter.execute(ContextualisingTaskExecuter.java:34)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter$1.run(CacheLockAcquiringTaskExecuter.java:39)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.CacheLockAcquiringTaskExecuter.execute(CacheLockAcquiringTaskExecuter.java:37)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:282)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.executeTask(DefaultTaskPlanExecutor.java:48)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.processTask(DefaultTaskPlanExecutor.java:34)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:27)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:89)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter$1.run(TaskCacheLockHandlingBuildExecuter.java:31)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:112)
at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:134)
at org.gradle.api.internal.changedetection.state.DefaultTaskArtifactStateCacheAccess.useCache(DefaultTaskArtifactStateCacheAccess.java:79)
at org.gradle.api.internal.changedetection.state.TaskCacheLockHandlingBuildExecuter.execute(TaskCacheLockHandlingBuildExecuter.java:29)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.access$200(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$2.proceed(DefaultBuildExecuter.java:67)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:61)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:54)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:166)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:64)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33)
at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50)
at org.gradle.api.internal.Actions$RunnableActionAdapter.execute(Actions.java:171)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:201)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:48)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.Main.main(Main.java:39)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32)
at org.gradle.launcher.GradleMain.main(GradleMain.java:26)
Caused by: java.lang.RuntimeException: Manifest merging failed. See console for more info.
at com.android.builder.AndroidBuilder.doMerge(AndroidBuilder.java:475)
at com.android.builder.AndroidBuilder.mergeLibraryManifests(AndroidBuilder.java:461)
at com.android.builder.AndroidBuilder.processManifest(AndroidBuilder.java:301)
at com.android.builder.AndroidBuilder$processManifest.call(Unknown Source)
at com.android.build.gradle.tasks.ProcessAppManifest.doFullTaskAction(ProcessAppManifest.groovy:65)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.groovy:71)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
at com.android.build.gradle.tasks.ProcessAppManifest_Decorated.invokeMethod(Unknown Source)
at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:217)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:210)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:199)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:526)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:509)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 67 more
Upvotes: 203
Views: 593238
Reputation: 592
I solved by putting this one line in application tag...
tools:node="replace"
Upvotes: 27
Reputation: 188
Downgrading my Java version from Zulu-17.jdk to Zulu-11.jdk fixed the issue for me.
Upvotes: 0
Reputation: 414
I wrote earlier, but now in 2023 this error can happen if you use Gradle Version 8.1 or later, and you use the com.huawei.agconnect
plugin in build.gradle(:app)
.
Upvotes: 0
Reputation: 2433
The solution to the Execution failed for task :app:processDebugMainManifest’ in React Native Android project for JDK 16, 17, and above is to add the following line in the ./android/gradle.properties file in your project:
org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED
The line above stops existing Gradle instances if some are already running, and the easiest way to do that would be to restart your OS.
Upvotes: -1
Reputation: 41
I was getting the same error while running my script in Android Studio. I had a mismatch of Java versions.
What I did, and it perfectly worked for me, is entering the command below in my terminal:
export JAVA_HOME="/Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home"
echo $JAVA_HOME
After running the command above, now run your script, you will not get any error.
PS - to find Android Studio's JAVA_HOME
path, go to File -> Project Structure
Upvotes: 0
Reputation: 161
Don't Need to Do anything just uninstall Npm.
npm uninstall
And again Install Npm.
npm install
in the App directory like ("C:\Users\Username\directory\YourAppDirectory") near to the app.js file. This is processer following in react native Then check Your npm Version. These errors came in my app because there were some files that were not installing, make sure all files install successfully. Don't use
Npm install -g or any things like that at time of install npm
Don't lose hope!
Upvotes: 0
Reputation: 684
In the manifest, add property android:exported="true"
to the launcher activity tag
android.name
property is mentioned in bothUpvotes: 4
Reputation: 1458
This is an answer for those who are experiencing a similar error while trying to run their Flutter app. To their credit, I discovered this by following Kevin ABRIOUX's answer.
My original error was:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:processDebugManifest'.
> Failed to query the value of task ':app:processDebugManifest' property 'mainMergedManifest'.
> Could not create task ':app:processDebugMainManifest'.
> java.lang.NullPointerException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
android
directory in Android Studio.In my particular case I have a secret that gets referenced by android/app/build.gradle
. If you are missing such a secret from android/local.properties
then step 2. is going to fail. Thankfully, it will give you an error that will point to the missing variable. Save any such variable to the file, close the studio, and repeat step 2. again.
Good luck and happy coding!
Upvotes: 1
Reputation: 303
In my case...I was targetting API 31. In the newer API you have to explicitly declare exported=true
or exported=false
on activities and receivers so that other apps can launch them i.e if you have any intent-filters you should declare "exported=true".
Upvotes: 3
Reputation: 2954
For Manifest merger failed: Apps targeting Android 12
add android:exported="true"
<activity android:name=".MainActivity"
android:exported="true"
>
Upvotes: 2
Reputation: 1435
My problem was solved after adding android:exported="true" on android.intent.category.LAUNCHER Activity
<activity
android:name=".MainActivity"
android:exported="true"> // Add this line
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Upvotes: 0
Reputation: 4477
This error might be because of an attribute left empty in the manifest file (AndroidManifest.xml
).
An example:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:logo="@drawable/ic_actionbar"
android:supportsRtl="true"
android:fullBackupContent=""> <!--THIS Line-->
...
</application>
The fullBackupContent
is empty in the above example.
When it's changed to android:fullBackupContent="true"
it will be fixed.
Upvotes: 2
Reputation: 2744
My solution was to delete Java folders completely from the computer and install fresh ones. And I mean delete the java folders manually from the roots otherwise some java cache will remain.
My bug was caused by android studio update.
good luck ya all
Upvotes: 0
Reputation: 1
Go to Files>Project structure>project and upgrade the gradle version. I had this problem. after that, I have upgraded my gradle 6.5 to 6.8. now its perfectly normal.
Upvotes: 0
Reputation: 1
The error happened to me while installing the "React-Native-Image-Picker" library. I was able to solve it like this:
Error:
> Task :app:processDebugManifest FAILED
I accessed this path which appeared to me in the complete error:
..\node_modules\react-native-image-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml
When reviewing the file I identified the versions requested by the library:
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" />
I modified in /android/app/build.gradle the following lines of code:
android {
...
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 29
}
}
Upvotes: 0
Reputation: 622
In my case I took the code from React Native Android Docs I added the
+ <uses-permission tools:node="remove" android:name="android.permission.READ_PHONE_STATE" />
+ <uses-permission tools:node="remove" android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+ <uses-permission tools:node="remove" android:name="android.permission.READ_EXTERNAL_STORAGE" />
but forgot the part I should add to manifest
xmlns:tools="http://schemas.android.com/tools"
After I add problem solved. Think that there is someone miss the same line like me.
Have a nice day!
Upvotes: 0
Reputation: 1388
I had
tools:replace="android:allowBackup"
in my AndroidManifest.xml file.
I have got the exact information in merged manifest section.
After removing it the error got resolved.
Upvotes: 0
Reputation: 1780
I solved this problem in Android Studio 3.5 by cleaning and rebuilding project.
Just click to Build -> Rebuild Project.
Upvotes: 0
Reputation: 1104
Just add these two lines at "gradle.properties":
android.useAndroidX=true
android.enableJetifier=true
Upvotes: 4
Reputation: 1357
Maybe you have some duplicated Activities
Like this:
<activity android:name=".register.RegisterStepsActivity" />
....
<activity android:name=".register.RegisterStepsActivity" />
just comment one of them
Upvotes: 1
Reputation: 812
In my case I had written the tag twice. That was my only mistake It was before code`
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
<application application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" >
</application>
`
Just removing the application tag solved my problem.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
The points you should have only one tag; can have more than one and , but one tag. That's what I know at this moment :)
Upvotes: 1
Reputation: 3879
In my context I removed the comment in manifest.xml and it worked.
Upvotes: -1
Reputation: 11
This Issue is raise because of compileSdkVersion 26 buildToolsVersion "26.0.0" or compile 'com.android.support:appcompat-v7:26.+'
instead of this use compileSdkVersion 25 buildToolsVersion "25.0.3" compile 'com.android.support:appcompat-v7:25.+'
Upvotes: 1
Reputation: 21
compile 'com.github.wenchaojiang:AndroidSwipeableCardStack:0.1.1'
If this is the dependency you have added then change it to:
compile 'com.github.wenchaojiang:AndroidSwipeableCardStack:0.1.4'
and make sure that target sdk
should not be less then 15.
Upvotes: 0
Reputation: 477
In my case I had into the manifest file an invalid tag structure, I had an opened activity closed but inside it where were ore activities (...)
which invalidates file correctness, to find it it took quite two hours, error reported missing/unknown <activity>
.
Upvotes: 0
Reputation: 17685
In a general way, to see what is the error, you can see the merged Manifest File in Android studio
Go on your manifest file
Click on the bottom tab "Merged Manifest"
On the right screen, in "Other Manifest Files", check for any error due to graddle :
Upvotes: 160
Reputation: 18356
In my case,
I define the activity twice in manifest file
<application
android:allowBackup="false"
android:label="@string/app_name"
>
<activity
android:name="com.xxx.ActivityOne"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize" />
//Problem here.. same activity twice define
<activity
android:name="com.xxx.ActivityOne"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="stateHidden|adjustResize" />
</application>
After remove the duplicate error solved.
Upvotes: 3
Reputation: 112
It could be a duplicate permission added in the manifest file. In my case "uses-permission android:name="android.permission.READ_PHONE_STATE" was repeated.
Upvotes: 4
Reputation: 25050
If you add dependencies such as ActionBarSherlock by Gradle,
carefully set your targetSdkVersion 17 or above.
Below quote is --info
logs when ActionBarSherlock mismatch with private project.
[C:\Me\Documents\GitHub\project\AndroidManifest.xml:3, C:\Me\Documents\GitHub\project\build\exploded-bundles\ComActionbarsherlockActionbarsherlock440.aar\AndroidManifest.xml:2] Main manifest has but library uses targetSdkVersion='17'
:testApp:processDebugManifest FAILED
It would be better that maintains own project targetSdkVersion
as newest as possible.
Upvotes: 6