Reviving an old project but the manifest merger failed? - java

I am reviving an old github repo of an instagram clone. The problem is, the manifest merger keeps failing.
I have tried updating, adding overrides, downgrading, removing then syncing then re-adding but nothing works.
I end up with the error:
Manifest merger failed with multiple errors, see logs
I think it has something to do with firebase starting because one of the error is as follows
2019-08-21 19:24:34.311 32240-32240/? E/FirebaseInstanceId: Failed to start service while in background: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.facebook.orca cmp=com.facebook.orca/com.facebook.push.fcm.FcmInstanceIDListenerService (has extras) }: app is in background uid UidRecord{c44bfd u0a246 TRNB idle change:uncached procs:1 proclist:32240, seq(0,0,0)}
Then again I get hundreds of other errors thrown at me upon running.
https://pastebin.com/TMsesZUX <- The full logcat
EDIT:
The error I get is:
Error: tools:replace specified at line:17 for attribute android:appComponentFactory, but no new value specified Android-Instagram-Clone-master-app main manifest (this file), line 16

SOLVED:
All I had to do was add
android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
in the application tag in my AndroidManifest.xml

Related

com.android.builder.internal.aapt.v2.Aapt2InternalException

Problem
It is working fine when i am building without release option. release option was working fine with android version 7.1.4
What is expected to happen?
it should build successfully
What does actually happen?
cordova build android --release
Information
build gradle file:
https://gist.github.com/indraraj26/a6efaed1135b0e394a23a1b192bc2c0c
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #0: Unexpected error during compile 'D:\client\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png', attempting to stop daemon. FAILED
20 actionable tasks: 1 executed, 19 up-to-date
This should not happen under normal circumstances, please file an issue if it does.
* 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 8s
D:\client>if "1" == "0" goto mainEnd
D:\client>rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
D:\client>rem the _cmd.exe /c_ return code!
D:\client>if not "" == "" exit 1
D:\client>exit /b 1
Command finished with error code 1: D:\client\platforms\android\gradlew cdvBuildRelease,-b,D:\client\platforms\android\build.gradle
D:\client\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #0: Unexpected error during compile 'D:\client\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
* 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 8s
Picked up _JAVA_OPTIONS: -Xmx512M
Error: D:\client\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.3.0-5013011-windows Daemon #0: Unexpected error during compile 'D:\client\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
* 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 8s
Picked up _JAVA_OPTIONS: -Xmx512M
at ChildProcess.whenDone (D:\client\node_modules\cordova-common\src\superspawn.js:135:23)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.cp.emit (D:\client\node_modules\cordova-common\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Command or Code
Environment, Platform, Device
Version information
ionic info
[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.
Ionic:
Ionic CLI : 5.4.4 (C:\Users\HP\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.2
#ionic/app-scripts : 3.2.2
Cordova:
Cordova CLI : 8.1.2 (cordova-lib#8.1.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 15 other plugins)
Utility:
cordova-res : 0.8.1
native-run : 0.2.9
System:
Android SDK Tools : 26.1.1 (C:\Users\HP\AppData\Local\Android\Sdk)
NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe)
npm : 6.10.2
OS : Windows 10
with this solution : https://stackoverflow.com/a/50973967/10842900
i am able to build apk but getting this errors
D:\client\platforms\android\app\src\main\res\drawable-land-hdpi\screen.png: Error: The drawable "screen" in drawable-land-hdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-land-ldpi\screen.png: Error: The drawable "screen" in drawable-land-ldpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-land-mdpi\screen.png: Error: The drawable "screen" in drawable-land-mdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-land-xhdpi\screen.png: Error: The drawable "screen" in drawable-land-xhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-land-xxhdpi\screen.png: Error: The drawable "screen" in drawable-land-xxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-land-xxxhdpi\screen.png: Error: The drawable "screen" in drawable-land-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-hdpi\screen.png: Error: The drawable "screen" in drawable-port-hdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-ldpi\screen.png: Error: The drawable "screen" in drawable-port-ldpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-mdpi\screen.png: Error: The drawable "screen" in drawable-port-mdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-xhdpi\screen.png: Error: The drawable "screen" in drawable-port-xhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-xxhdpi\screen.png: Error: The drawable "screen" in drawable-port-xxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
D:\client\platforms\android\app\src\main\res\drawable-port-xxxhdpi\screen.png: Error: The drawable "screen" in drawable-port-xxxhdpi has no declaration in the base drawable folder or in a drawable-densitydpi folder; this can lead to crashes when the drawable is queried in a configuration that does not match this qualifier [MissingDefaultResource]
Explanation for issues of type "MissingDefaultResource":
If a resource is only defined in folders with qualifiers like -land or -en,
and there is no default declaration in the base folder (layout or values
etc), then the app will crash if that resource is accessed on a device
where the device is in a configuration missing the given qualifier.
As a special case, drawables do not have to be specified in the base
folder; if there is a match in a density folder (such as drawable-mdpi)
that image will be used and scaled. Note however that if you only specify
a drawable in a folder like drawable-en-hdpi, the app will crash in
non-English locales.
There may be scenarios where you have a resource, such as a -fr drawable,
which is only referenced from some other resource with the same qualifiers
(such as a -fr style), which itself has safe fallbacks. However, this still
makes it possible for somebody to accidentally reference the drawable and
crash, so it is safer to create a default dummy fallback in the base
folder. Alternatively, you can suppress the issue by adding
tools:ignore="MissingDefaultResource" on the element.
(This scenario frequently happens with string translations, where you might
delete code and the corresponding resources, but forget to delete a
translation. There is a dedicated issue id for that scenario, with the id
ExtraTranslation.)
12 errors, 0 warnings
The reason this is failing is that there was a bug in aapt2's code for crunching (compressing) PNG files. PNG crunching is automatically disabled for debug builds, but turned on for release, that's why you only saw this in your release builds.
This has been fixed now, so just update your android gradle plugin version and you will get the aapt2 with the fix automatically. I'd suggest 3.5 or newer.
I also see you're on windows, so you might run into another issue that's common if you try to update to 3.5. Aapt2 daemons might fail to start - in that case you just need to install the Windows Universal C Runtime Library.

Android Studio XML Error

Currently testing out Android Instant Apps using Android Studio 3.0 Canary 3 and I'm getting this error when I try to build the app and emulate it.
Any ways to fix it? (I'm making a multi-feature Instant App).
Error:
~/Documents/GitHub/AndroidInstantApp/android-topeka/topeka-ui/build/intermediates/manifests/full/feature/debug/AndroidManifest.xml:2
attribute 'split' in tag is not a valid split name
Error:com.android.builder.internal.aapt.AaptException: AAPT2 link
failed: Error:java.util.concurrent.ExecutionException:
com.android.builder.internal.aapt.AaptException: AAPT2 link failed:
Error:Execution failed for task
':topeka-ui:processDebugFeatureResources'.
Failed to execute aapt
I think we may have found a bug of this alpha release.
I solved the problem by removing the dash ("-") from the module name:
Apparently it is not well supported for split names.
The strange part is, both the codelabs and my project were initially working correctly with the dash.

Intermittent failure of dependencyCheck on Jenkins

We are using the owasp dependencyCheck plugin in our project.
Version used: 1.4.5
We are facing the following issue in our build jobs on Jenkins:
The build job fails intermittently saying " :dependencyCheck FAILED "
The stacktrace of the error is as follows:
:dependencyCheck
Verifying dependencies for project stock-service
Checking for updates and analyzing vulnerabilities for dependencies
Unable to update Cached Web DataSource, using local data instead. Results may not include recent vulnerabilities.
Exception occurred initializing CPE Analyzer.
Generating report for project stock-service
Found 0 vulnerabilities in project stock-service
:dependencyCheck FAILED
Caused by: org.owasp.dependencycheck.exception.ExceptionCollection: One or more exceptions occurred during dependency-check analysis
org.xml.sax.SAXException: Unable to get primary key for new cpe: cpe:/a:uchida_yoko_co._ltd:assetbase:8.0
org.owasp.dependencycheck.data.nvdcve.DatabaseException: Unable to get primary key for new cpe: cpe:/a:uchida_yoko_co._ltd:assetbase:8.0
An exception occurred accessing the database
at org.owasp.dependencycheck.Engine.analyzeDependencies(Engine.java:543)
at org.owasp.dependencycheck.Engine$analyzeDependencies$0.call(Unknown Source)
at org.owasp.dependencycheck.gradle.tasks.Check.check(Check.groovy:86)
... 66 more
If your code has multiple microservices, then all the services create a database locally on Jenkins and update it as part of owasp dependencyCheck task on the following location:
/{your jenkins
directory}/.gradle/caches/modules-2/files-2.1/org.owasp/dependency-check-utils/dependency-check-data/3.0/dc.h2.db
Since this file is shared by all the services, there are locking issues. If any one service fails during build, the lock that it created on the file is not removed and thus the other services would subsequently fail.
Following link describes the issue and suggests a solution:
https://github.com/jeremylong/DependencyCheck/issues/410
This solution was not usable as is, we had to change the "autoUpdate=true" so that the service creates a db file if it does not already exist.
After the above change ( i.e adding "data directory" configuration in dependencyCheck task [visit the above link for this config]),
the issue seems to have been fixed.

no package identifier when getting value for resource number 0x00000000

I am new to Android app development. I try to connect my app with facebook using SocialAuth SDK. but am getting a error as
"no package identifier when getting value for resource number 0x00000000" and thread id=1: thread exiting with uncaught exception (group=0xb2a40ba8) then it goes to FATAL EXCEPTION: main.
I have tried to clean and build the project, but nothing happens, still getting same errors.
Can anyone help me to resolve this problem.?
08-04 11:28:15.642: E/AndroidRuntime(2227):
android.content.res.Resources$NotFoundException: Resource ID
You have to put Icon for facebook named facebook.png into your res (Resource) folder it's not able to find it right now that's why you are getting ResourcesNotFoundException.

Service will not start: error 1067: the process terminated unexpectedly

We have a custom service that we install with our application. The only problem is that after it is installed, it will not start, generating the error above. I have tried to diagnose what the problem is, but can't seem to find any useful information as to why it is quitting. I have tried the same service on a non "R2" 2008 server, and manual it worked fine.
service simple java file running using batch file. Deamon service.
Has anyone had any experience troubleshooting this type of problem, where there are so few clues?
Goto:
Registry-> HKEY_LOCAL‌​_MACHINE-> System-> Cur‌​rentControlSet-> Servi‌​ces.
Find the concerned service & delete it. Close regedit. Reboot the PC & Re-install the concerned service. Now the error should be gone.
This is a problem related permission.
Make sure that the current user has access to the folder which contains installation files.
I resolved the problem.This is for EAServer Windows Service
Resolution is -->
Open Regedit in Run prompt
Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\EAServer
In parameters, give SERVERNAME entry as EAServer.
[It is sometime overwritten with Envirnoment variable : Path value]
This error message appears if the Windows service launcher has quit immediately after being started.
This problem usually happens because the license key has not been correctly deployed(license.txt file in the license folder).
If service is not strtign with correct key, just put incorrect key and try to start. Once started, place the correct key, it will work.
I had this error, I looked into a log file C:\...\mysql\data\VM-IIS-Server.err and found this
2016-06-07 17:56:07 160c InnoDB: Error: unable to create temporary file; errno: 2
2016-06-07 17:56:07 3392 [ERROR] Plugin 'InnoDB' init function returned error.
2016-06-07 17:56:07 3392 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-06-07 17:56:07 3392 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-06-07 17:56:07 3392 [ERROR] Aborting
The first line says "unable to create temporary file", it sounds like "insufficient privileges", first I tried to give access to mysql folder for my current user - no effect, then after some wandering around I came up to control panel->Administration->Services->Right Clicked MysqlService->Properties->Log On, switched to "This account", entered my username/password, clicked OK, and it woked!
In my case the error 1067 was caused with a specific version of Tomcat 7.0.96 32-bit in combination with AdoptOpenJDK. Spent two hours on it, un-installing, re-installing and trying different Java settings but Tomcat would not start. See...
ASF Bugzilla – Bug 63625
seems to point at the issue though they refer to seeing a different error.
I tried 7.0.99 32-bit and it started straight away with the same AdoptOpenJDK 32-bit binary install.
I solved this issue using Monitor Tomcat application. I ran it and after a few seconds its icon appeared in my system tray. I right clicked on the icon and clicked the start button and after a few seconds Apache Tomcat started.

Categories