Tag Archives: Android

[Solved] Execution failed for task ‘:app:uploadCrashlyticsMappingFileRelease‘

Problem: Recently, when doing a project, an error occurred in the online package of release:

 Execution failed for task ':app:uploadCrashlyticsMappingFileRelease'

 

Reason: This problem is caused by the use of Google’s firebase library, which is the culprit:

com.google.firebase:firebase-crashlytics

 

Solution: Add the following code to Android {} of gradle of app

gradle.taskGraph.whenReady {
    tasks.each { task ->
        if (task.name.contains("uploadCrashlyticsMappingFileRelease")) {
            task.enabled = false
        }
    }
}

Note: this method can only solve this issue temporary, if you know other solutions, please leave a comment and let me know!

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

When developing Android, you sometimes encounter such problems

Error:Execution failed for task ':app:processBaiduDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs

The processing method is as follows:
Enter the command line first, and pay attention to adding ./ on Mac when entering the command,

./gradlew processBaiduDebugMainManifest –stacktrace

Here processBaiduDebugMainManifest will replace according to the specific information of your error report, and may also encounter the problem of no permission, as shown in the following figure

The simplest solution is to add bash before the command. The complete command is:

bash ./gradlew processBaiduDebugMainManifest –stacktrace

This command will get more log information.

With specific error information, you can purposefully solve the problem.

[Solved] Unity packaged and exported apk error: Failed to load libmain.so’

Today I packaged the APK on my mobile phone and found that I couldn’t enter the main page, and it kept prompting
As shown in the figure below, the part of the package name is lost

insert image description here

Failure to initialize! Your hardware does not support this
application. Failed to load libmain.so’ java.lang.
UnsatisfiedLinkError: dalvik.system.PathClassLoaderl DexPathList|(zip
file “/data/app/ package name-v9hxALnNbA
vIVbwOmlIHfw==/base.apk”I,nat iveLibraryDirectories=|/data/app/
package name-v9hxALnNb AvIVbwOmlIHfw==/lib/arm64,/data/
app/package name-v9hxALn NbAvIVbwOmlIHfw==/base.apk!/
lib/arm64 -v8a, /system/lib64, /system/product/lib64ll couldn’t find
“libmain.so” Press OK to quit.

I checked several methods but couldn’t use it. Finally, I changed the compilation settings to solve the problem.
Changed to ARMv7 as shown in the figure and it will be normal. If ARM64 is needed, it can be solved elsewhere.
Now this is the case. The package is delivered normally, record it
insert picture description here

Android Studio: Gradle project sync failed [How to Solve]

Question:

Unable to find method ”java.lang.String org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()

Reference:

gradle issues details in discription – Stack Overflow

Solution:

Upgrade Android Studio.

Stack Overflow says to upgrade IntelliJ Idea. Similarly, The version of Android Studio is too low, and does not match the gradle version.

[Solved] Android Compile and Package Error: Invalid keystore format

Problem description

Running an old open source project, compiles the following error.

java.io.IOException: Invalid keystore format
Execution failed for task ':app:transformDexWithInstantRunDependenciesApkForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "C:\Users\a do\.android\debug.keystore": Invalide keystore format

Solution

According to the error message, there is a problem with the debug signature format.

We only need to open the c drive, in the current user’s directory, there is a .android directory, delete the debug.keystore inside.

If it prompts that the process is occupied, exit Android Studio first. Then delete it again.

Finally re-running the project, will automatically generate debug.keystore.

How to Solve UE4 packaging Android error

UE4 packaging Android error reporting solution

Error:

insert picture description here

The error is as above

Workaround:

1. Find the UE installation directory UE_4.26\Engine\Extras\Android such as :

E:\UE4\UE4An\UE_4.26\Engine\Extras\Android

2. Start the SetupAndroid.bat file in this directory

insert picture description here

3. The file starts to download sdk, According to the download prompt, you can know the sdk download directory.

insert picture description here

4. Open UE, in the project settings ProjectSettings to Android SDK to configure the SDK corresponding to the download in the previous step, in which, NDK is also in the download directory, jdk can use 1.8.0

insert picture description here

5. Package successfully

insert picture description here

[Solved] Flutter Error: fluwx:compileDebugKotlin

Flutter reports an error fluwx:compileDebugKotlin

Cause Analysis

The reason for this exception found on the Internet is basically that the kotlin version does not conform to the cause, Maybe the kotlin version will also cause this error.
But my error is not due to the kotlin version problem, but due to the conflict of the component cache version pulled down by the pub command, as shown below:
insert picture description here
fluwx-3.9.1 and 3.9.2, delete and yml file Inconsistent versions resolve this exception.

Summary

Component name: There may be two reasons for the exception of compileDebugKotlin:
1. The kotlin version often said on the Internet does not conform to
2. There are different versions of the components in the pub cache and they conflict

[Solved] Android Studio 3.0 Error: Error: INSTALL_FAILED_TEST_ONLY

Reason: After Android Studio 3.0, when generating debug apk, the android:testOnly=”true” attribute is automatically added in the application tag of the apk’s manifest file. android:testOnly=” true” This tag was originally used for testing, so packages with this tag cannot be installed in general, and need to be installed in a special way (by adding the -t flag).

Solution:

Method 1: Set: android.injected.testOnly=false in the global configuration gradle.properties file in the project

Method 2: Add -t property: adb install -t app-debug.apk

 

[Solved] Android Studio Generate APK Error: error_prone_annotations.jar (com.google.errorprone:error)

Android Studio failed to generate apk error:

Could not download error_prone_annotations.jar (com.google.errorprone:error)

 

Solution:

Modify the buildscript and allprojects in build.gradle file of your project:

google()jcenter()

to

maven { url ‘https://maven.aliyun.com/repository/google’ }maven { url ‘https://maven.aliyun.com/repository/jcenter’ }maven { url ‘http://maven.aliyun.com/nexus/content/groups/public’ }

Done!

[Solved] AndroidStudio package Invalid keystore format Error: Execution failed for task ‘:examplecases:packageRelease’…

Post error information first

Execution failed for task ':examplecases:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
   > com.android.ide.common.signing.KeytoolException: Failed to read key aaa from store "C:\Users\a\Desktop\NewProject\aaa.jks": Invalid keystore format

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

 

 

Solution:

Open file -> settings.

Set the JDK version to 11, repack and solve the problem.