Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-37 value=(com.app.app)
has a different value=(com.app.app) declared in main manifest at AndroidManifest.xml:2:5-34
Suggestion: remove the overlay declaration at AndroidManifest.xml and place it in the build.gradle:
flavorName {
applicationId = "com.app.app"
}
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
Manifest merger failed : Overlay manifest:package attribute declared at AndroidManifest.xml:2:5-37 value=(com.app.app)
has a different value=(com.app.app) declared in main manifest at AndroidManifest.xml:2:5-34
Suggestion: remove the overlay declaration at AndroidManifest.xml and place it in the build.gradle:
flavorName {
applicationId = "com.app.app"
}
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 4m 44s
Exception: Gradle task assembleDebug failed with exit code 1
How i can fix this problem?
Try to search them and change your package name in the following locations:
1.) src/profile/AndroidManifest.xml
2.) src/debug/AndroidManifest.xml
3.) src/main/AdroidManifest.xml
4.)
build.gradle .
defaultConfig {
applicationId
5.) MainActivity.java on "package"
If you want to know exactly how to achieve that, take a look at this page for further support.
The best solution to this is by changing the package name in all these 5 files.
1.) android/app/src/debug/AndroidManifest.xml
2.) android/app/src/main/AndroidManifest.xml
3.) android/app/src/profile/AdroidManifest.xml
4.) buildgradle file defaultConfig {applicationId: ""}
5.) MainActivity.java on "package" OR MainActivity.kotlin
After modifying the above files, the Flutter App run seamlessly any issues.
Related
How I fix this error
\android\app\src\debug\AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.kathana">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
build.gradle
How I fix it
debug console
D:\Working\Intern\Codes\Apps\kathana\android\app\src\debug\AndroidManifest.xml:27:9-33:20 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.
D:\Working\Intern\Codes\Apps\kathana\android\app\src\debug\AndroidManifest.xml:34:9-40:20 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.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
Manifest merger failed with multiple errors, see logs
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 4s
Exception: Gradle task assembleDebug failed with exit code 1
Since your application is targeting Android 12, please take a look at your AndroidManifest.xml and make sure to add this android:exported.
It's also answered here - https://stackoverflow.com/a/67412314/12862313 with further reading links.
I found the error . That's not "android:exported="true" " , I comment android build.gradle dependencies and run the project one by one. Finally I commented the "implementation 'com.facebook.android:facebook-android-sdk:latest.release'" this facebook dependencies then project worked prefect. But I want facebook dependencies for my project therefore I added newest dependencies " implementation 'com.facebook.android:facebook-login:5.+'"
check app/build/intermediates/merged_manifests/release/AndroidManifest.xml for any activities that use that do not have android:exported = true.
In my case I had to add these two lines in the main AndroidManifest.xml
Please note that I had this issue on React Native, not on flutter.
<activity android:exported="true" android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity" android:theme="#style/InstrumentationActivityInvokerFloatingActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
<activity android:exported="true" android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity" android:theme="#style/InstrumentationActivityInvokerEmptyActivityTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>
</activity>
I'm new to stackoverflow, so I don't how to manage question in good way. Sorry for that.
When I tried to run npx react-native run-android || npm run android, it throws me this error?
> Task :app:processDebugMainManifest FAILED
[:react-native-firebase_app] /home/groot/ALL_MINE/REACT/REACT_NATIVE/EDesign/node_modules/#react-native-firebase/app/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning:
Package name 'io.invertase.firebase' used in: :react-native-firebase_app, :#react-native-firebase_app.
[com.google.android.ads.consent:consent-library:1.0.6] /home/groot/.gradle/caches/transforms-3/61220cba941701c55a6acecb5d3d8e99/transformed/jetified-consent-library-1.0.6/AndroidManifest.xml Warning:
Package name 'com.google.android.ads.consent' used in: com.google.android.ads.consent:consent-library:1.0.6, com.google.android.ump:user-messaging-platform:1.0.0.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
132 actionable tasks: 2 executed, 130 up-to-date
/home/groot/ALL_MINE/REACT/REACT_NATIVE/EDesign/android/app/src/debug/AndroidManifest.xml:11:73-127 Error:
Attribute meta-data#com.google.android.gms.ads.APPLICATION_ID#value value=(ca-app-pub-1030707148416513~6139129872) from AndroidManifest.xml:11:73-127
is also present at [:invertase_react-native-google-ads] AndroidManifest.xml:16:13-29 value=().
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:11:5-129 to override.
FAILURE: Build failed with an exception.
How to solve this, I'm stucked here...
you just need to add your admob ApplicationId to the manifest file.
<application>
***
<!-- Sample AdMob app ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"
tools:replace="android:value"/>
also don't forget to add,
xmlns:tools="http://schemas.android.com/tools"
Try this First React Native App: Task :app:processDebugMainManifest FAILED
In my case, the answer by Nicofisi works:
Append the following line to the ./android/gradle.properties file in your project:
org.gradle.jvmargs=--add-opens java.base/java.io=ALL-UNNAMED
I am building an application using flutter and flutterfire (which allows me to use flutter and firebase). With flutterfire I am using firebase_auth. I stopped development for a few weeks and came back to my app not working. I narrowed the issues down to it being my firebase_auth not working. In order to test this, I created a brand new firebase app on Android Studios and tried to connect it to flutterfire. I did all the necessary steps to do this and decided to first test cloud_firestore to see if it would work. It did. As soon as I added the line for firebase_auth in my pubspec.yaml file my app would not even build. The errors I get are below. I have tested previous versions of flutter_fire as well.
D8: Cannot fit requested classes in a single dex file. Try supplying a
main-dex list.
methods: 65968 > 65536
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/5.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/6.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/7.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/8.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/303.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/304.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/305.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/306.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/307.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/308.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/309.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/310.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/311.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/312.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/313.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/314.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/315.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/316.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/317.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/318.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/319.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/320.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/321.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/322.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/323.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/324.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/325.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/326.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/327.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/328.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/329.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/330.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/331.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/332.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/333.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/334.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/335.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/336.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/337.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/338.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/339.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/340.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/341.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/342.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/343.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/384.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/390.jar, /Users/nolan/Documents/development/lp_2/lp_2/build/app/intermediates/transforms/dexBuilder/debug/396.jar
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at
https://developer.android.com/tools/building/multidex.html
* 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 2s
Finished with error: Gradle build failed: 1
The problem looks more Android related and not iOS or Flutter.
If your minSdkVersion is set to 21 or higher, all you need to do is set multiDexEnabled to true in your module-level build.gradle file, as shown here:
android {
defaultConfig {
...
minSdkVersion 21
targetSdkVersion 26
multiDexEnabled true
}
...
}
More info: https://developer.android.com/studio/build/multidex especially if minSdkVersion < 21
I am testing 9-patch image .
Before everything works fine , and i rename drawable file ic_button_beat_box_default.png to ic_button_beat_box_default.9.png , then i get error :
Some file crunching failed, see logs for details
. Then i rename back , it works normal. So how this happens ?
The complete error is :
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
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)
...
Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for details
at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java:260)
at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:280)
at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:132)
at com.android.ide.common.res2.DataMerger.mergeData(DataMerger.java:291)
at com.android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.java:48)
at com.android.build.gradle.tasks.MergeResources.doIncrementalTaskAction(MergeResources.java:250)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:124)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:244)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:231)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:209)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 57 more
On Windows I had a "BUILD FAILED Failed to crunch file [path]" error and solved it by closing the Android Studio project, copying the entire project folder into a location with a shorter directory path, such as my C: folder and then opening the project in the new location. Hope it helps
Rename your file again
ic_button_beat_box_default.9.png to ic_button_beat_box_default9.png because android studio takes ic_button_beat_box_default.9 instead of ic_button_beat_box_default.9.png
or another solution is add below line to your build.gradle(Module:app)
android{
aaptOptions {cruncherEnabled = false}
}
I had the same issue by changing only file name, when I saved the image in 9-patch-tool issue solved.
I had the same issue. I was able to resolve it just by reducing one folder from chain. It is due to long file path. So try using minimum hierarchy for your project location.
try this, insert this code in android section in app gradle:
aaptOptions {
cruncherEnabled = false
}
I have red other similar questions and answers to them on SO, regarding that "file crunching failed, see logs for details" error.
Nothing helped.So,I reverted all "SO" changes I made with gradle and other files
and removed ".9" in that png.9 files and it began work.
Then I recreated all *.9.png files again.
Hence, in my case the cause was wrong editing of 9.pngs in external png editors.
What solved it for me was to set
aaptOptions {
cruncherEnabled = false
}
Then to run the app (icons were missing)
then remove this option and run the app again.
Hope it helps somebody.
This worked for me:
Build -> Clean Project.
and then
Build -> Rebuild Project.
Since Google recently announced that Android Studio is the official IDE for Android developement I decided to change my work environment from the Eclipse IDE to Android Studio.
After importing the project to Android Studio I've come across a strange error.
The error says that it can't find two existing R.drawables in an array of R.drawables, the resources are two png pictures.
Here is the syntax of the array:
flag = new int[] {R.drawable.thegodfather,R.drawable.thegeneral,R.drawable.kingofcomedy,
R.drawable.drstrangelove,R.drawable.thebiglebowski}
The two R.drawables that is causing the error are thegodfather and kingofcomedy.
Here is the error messages:
(1)
> Error:(101, 32) error: cannot find symbol variable thegodfather
> Error:(101, 78) error: cannot find symbol variable kingofcomedy
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> > Compilation failed; see the compiler error output for details.
(2)
/Users/rawandsultani/Documents/ANDROID/V1/v11/app/src/main/java/com/exple/top100/Top100Activity.java:101: error: cannot find symbol
flag = new int[] {R.drawable.thegodfather,R.drawable.thegeneral,R.drawable.kingofcomedy,
^
symbol: variable thegodfather
location: class drawable
/Users/rawandsultani/Documents/ANDROID/V1/v11/app/src/main/java/com/exple/top100/Top100Activity.java:101: error: cannot find symbol
flag = new int[] {R.drawable.thegodfather,R.drawable.thegeneral,R.drawable.kingofcomedy,
^
symbol: variable kingofcomedy
location: class drawable
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
After countless efforts of cleansings, rebuildings, invertings and restarts the same error still exists. I have checked that the resource is actually there and I have deleted and replaced it just to be sure. It still doesn't work.
What is causing Android Studio to ignore theese two resources?
Here is the beginning of my Android-manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exple.v1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="23" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
And here is my Gradle.build :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.exple.v1"
minSdkVersion 11
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:support-v4:23.0.1'
}
Again, I have no clue what is causing this problem. After searching on Stack I've found out that some have had a similiar problem but solved it by cleaning the project or restarting Android Studio which has not worked out for me.
The manifest file and the Gradle.build is for extra information
just in case anyone need a look at it.
Have you verify the do exist in the appropiate folder with the correct name in the Android project?
EDIT:
Have you tried to remove them (Delete) and add them from Android Studio instead of the imported version?
I had the same problem with an existing resource in an imported project from eclipse. In my case the issue was that the resource called loading.png was in fact a .gif, after I fixed the extension the compiler generate the right R.drawable.loading variable.
When Android Studio imported the project it showed this message, but i didnt appear in the sub-sequence compilations
:app:mergeDebugResources
AAPT out(251470765) : No Delegate set : lost message:Done
AAPT err(251470765): libpng error: Not a PNG file
I know it's an old ( very old ) topic, but I just had the same problem and I soon realized that I had placed the resource in a wrong folder ( drawable-v24 instead of drawable ) which was the reason for this resource to be found on other devices. Switch to project instead of android view and check variant specific folders.