Tag Archives: Android

[Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.

CommandInvokationFailure: Gradle build failed.
F:/Program Files/Unity/2017.4.31f/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “F:\Program Files\Unity\2017.4.31f\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.0.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

 

Solution:

if there is where in the error message: followed by garbled characters, it means that the path is wrong, and neither the project nor the signature can be in English.

Manifest merger failed with multiple errors, see logs [How to Solve]

Today, when accessing an Android SDK, I reported a problem of manifest merge failed with multiple errors, see logs. Google said that this problem often occurs when introducing a third-party SDK. In fact, it is a dependency conflict
you can see the specific error information above the error, as shown below

it indicates that there is a com.tencent.mid conflict. Just exclude

[Solved] android Execution failed for task ‘:app:processDebugManifest‘

Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.3.1] AndroidManifest.xml:24:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=”android:appComponentFactory”‘ to <application> element at AndroidManifest.xml:5:5-20:19 to override.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.

Execution failed for task ‘:app:processDebugManifest’.
> Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.3.1] AndroidManifest.xml:24:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add ‘tools:replace=”android:appComponentFactory”‘ to <application> element at AndroidManifest.xml:5:5-20:19 to override.
* 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.

After upgrading Android Studio to 4.2 today, I set up the project as before. A few days ago, it was fine (the previous version of Androidstudio 4.0). The third package and the version are the same. They are all copied from the runnable project. Suddenly this error was reported. According to other methods on the Internet, it will not work. The problem is mainly a package conflict, that is, the package conflict between appcomcat and AndroidX.
Solution:
It is found that after upgrading to Androidstudio4.2, in the gradle.properties file, the default android.enableJetifer = true attribute (that is, the third-party package is converted to AndroidX) is removed, and this attribute will not be reported after adding mistaken.

[Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac

Record ue4.27 Android packaging failure compileDebugJavaWithJavac

Enter the project folder G: \UE4_Project\MyProject\Intermediate\Android\arm64\gradle

Execute CMD  gradlew compileDebugJavaWithJavac

Solutions:

1. Add the red part to the .Build.cs of the project

2. Create extra file_UPL_.xml

3. Paste the following content into XML

<?xml version="1.0" encoding="utf-8"?>
<!-- XML -->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Gradle Properties -->
<gradleProperties>
<insert>
ANDROID_BUILD_TOOLS_GRADLE_VERSION=com.android.tools.build:gradle:3.5.3
</insert>
</gradleProperties>
</root>

Execution failed for task :Test:lintVitalRelease/Lint found fatal errors while assembling a release

Specific error

Execution failed for task ':usbCameraTest:lintVitalRelease'.
> Lint found fatal errors while assembling a release target.

* 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.

terms of settlement

Add in build.gradle:

android {

	lintOptions {
		checkReleaseBuilds false
		abortOnError false
	}

java.net.SocketException: socket failed: EPERM (Operation not permitted)

java.net.SocketException: socket failed: EPERM (Operation not permitted)

This problem always occurs when using asynchttpclient to make network requests. If you add network permissions

, you still can’t

Finally, I saw the solution of @ no forest in Norway. Uninstall the program in the virtual machine and reinstall it.
although I don’t know the principle, I still record it

How to Solve Kotlin unresolved reference error

A crazy problem is that after the project is transferred to kotlin, it always reports: unresolved reference: XXXXXXX
the pre compilation of the project can report no error, but the problem is reported as soon as the mark is marked. The location of the problem is related to the interface defined by kotlin in in the project,
so it begins to solve:
check whether there are bugs in the definition code of the interface. The conclusion is no problem. Check whether there are bugs in the implementation of the interface. The conclusion is that the implementation class has not been executed to the environment, whether there are problems, and the version of gradle and other related tools has not been upgraded. Therefore, create a new kotlin module to import the error interface class, Results it works normally

conclusion:
when defining the interface of kotlin in the module of Java environment, an error will be reported during compilation.

OTA Pack Compile Error: ExternalError: Failed to run signapk.jar: return code 1:Error: A JNI error has occurred

Android 11 reports an error during OTA package:

ExternalError: Failed to run signapk.jar: return code 1:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/signapk/SignApk has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)

According to the error analysis, it is caused by the jdk version.

1. First check the jdk version: java –version My previous version was openjdk-8
2. Use sudo apt-get install openjdk-11-jdk to install openjdk-11
3. Configure linux default jdk version: sudo update-alternatives –config java, select the JDK version you need
4. Configure the default java version: sudo update-alternatives –config javac, select the java version you need.

Just do the ota package again.