Tag Archives: Android

Error when loading the SDK: Solutions

error:

when eclipse opens the following window appears (with the following contents)

Error when loading the SDK:

Error: Error parsing \Android\ t-bundle-windows-x86_64-20140702\ SDK \system-images\android-22\android-wear\armeabi-v7a\devices. XML
cdc-complex type. Invalid content starting with element ‘d:skin’ was found. There should be no child elements here. Error: Error: Error D:\Android\adt-bundle-windows-x86_64-20140702\ SDK \system-images\android-22\android-wear\x86\devices. XML
cdc-complex type. Invalid content starting with element ‘d:skin’ was found. There should be no child elements here. balabala

solution:

D:\Android\adt-bundle-windows-x86_64-20140702\ SDK \tools\ devices under lib. XML file replace

D: \ Android \ adt – bundle – Windows – x86_64-20140702 \ \ Android SDK \ system – images – 22 \ Android – wear \ armeabi – v7a and

D:\Android\adt-bundle-windows-x86_64-20140702\ SDK \system-images\android-22\android-wear\ devices under x86. XML file,

restart eclipse.


Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

error when installing apk to the phone via adb install -r :

Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]

reason:

 ndk {
                abiFilters "armeabi-v7a"
//                abiFilters "x86"
            }

:
due to install the APP using the native libraries with the current CPU architecture do not agree, so lead to an error, because the vast majority of smartphones are now using the ARM architecture, while android is support ARM and x86 architecture, but the instruction set is distinct, the APP is used when development ARM of the local library, and we were using the AVD is used when creating the simulator x86 CPU, thus result in an error. So, if the APP is compiled in an x86 architecture we create an emulator for x86CPU, and if the APP is compiled in an ARM architecture we create an emulator for ARMcpu.

is the NDK selected by the packaged apk generation is not compatible with the NDK of the mobile phone system. As long as the NDK type is modified and repackaged,

is ok

An error is reported for the new Android project. Rejecting re init on previously failed

error

03-20 14:54:57.718 7909-7909/?I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
03-20 14:54:57.719 7909-7909/?I/zygote64:     at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
        at void android.support.v7.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)
        at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
        at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
        at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:651)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:794)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:734)
        at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:867)
        at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
        at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:519)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:427)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
        at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607)
        at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
        at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void com.example.kingnewspring.kotlintest.MainActivity.onCreate(android.os.Bundle) (MainActivity.kt:24)
        at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7098)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7089)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1215)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2770)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
        at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
        at void android.os.Looper.loop() (Looper.java:173)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6653)
        at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:821)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.kingnewspring.kotlintest-f-pJtef5aNEspOp1AQerjw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.kingnewspring.kotlintest-f-pJtef5aNEspOp1AQerjw==/lib/arm64, /system/lib64, /system/vendor/lib64]]
        at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
        at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
        at void android.support.v4.view.ViewCompat.setBackground(android.view.View, android.graphics.drawable.Drawable) (ViewCompat.java:2341)
        at void android.support.v7.widget.ActionBarContainer.<init>(android.content.Context, android.util.AttributeSet) (ActionBarContainer.java:62)
        at java.lang.Object java.lang.reflect.Constructor.newInstance0(java.lang.Object[]) (Constructor.java:-2)
        at java.lang.Object java.lang.reflect.Constructor.newInstance(java.lang.Object[]) (Constructor.java:334)
        at android.view.View android.view.LayoutInflater.createView(java.lang.String, java.lang.String, android.util.AttributeSet) (LayoutInflater.java:651)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:794)
        at android.view.View android.view.LayoutInflater.createViewFromTag(android.view.View, java.lang.String, android.content.Context, android.util.AttributeSet) (LayoutInflater.java:734)
        at void android.view.LayoutInflater.rInflate(org.xmlpull.v1.XmlPullParser, android.view.View, android.content.Context, android.util.AttributeSet, boolean) (LayoutInflater.java:867)
        at void android.view.LayoutInflater.rInflateChildren(org.xmlpull.v1.XmlPullParser, android.view.View, android.util.AttributeSet, boolean) (LayoutInflater.java:828)
        at android.view.View android.view.LayoutInflater.inflate(org.xmlpull.v1.XmlPullParser, android.view.ViewGroup, boolean) (LayoutInflater.java:519)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup, boolean) (LayoutInflater.java:427)
        at android.view.View android.view.LayoutInflater.inflate(int, android.view.ViewGroup) (LayoutInflater.java:374)
        at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:607)
        at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
        at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
        at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
        at void com.example.kingnewspring.kotlintest.MainActivity.onCreate(android.os.Bundle) (MainActivity.kt:24)
        at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7098)
        at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7089)
        at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1215)
        at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2770)
        at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
        at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
        at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
        at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
        at void android.os.Looper.loop() (Looper.java:173)
        at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6653)
        at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
        at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
        at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:821)

error scenario

, directly create a new android project, all default configuration, after running error, but the error will not affect the use, will not cause flash back, so the error level is not very high, even can not deal with, but a little obsessive I still decided to solve it

error analysis

 Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;

prompt class find error: Java. Lang. NoClassDefFoundError , and indicates the class
android/view/view $OnUnhandledKeyEventListener , so we found this interface according to the directory:

android View class. PNG

figure top left see a row of prompts, prompt no API 28 resources! I see, I did not install the android SDK, 28 API, but I compiled version is api28 , although this is not the root cause of the problem (even if you have installed the android 9.0 is api28 SDK is also an error), but it reminds me that may be the reason for the runtime platform, and my mobile phone system debug is 27 API, compiled versions than low!!!!! :

app build.gradle file. PNG

so far, we know the solution to the problem

solution

My mobile phone is api27. Note that dependency also needs to be changed to

after modification. PNG

debug again, the console did not report an error again! In the spirit of verification, I searched the interface I just failed to find, and found that

was really not found in api27 platform

cannot search the class. PNG

looks like the interface is indeed the beginning of API 28.

summary
The

compiled version should not be misused, need to be careful. Not a big deal, just give your ocD friend a solution to the problem.

The solution of “failed to load il2cpp” in Android package launched by unity

recently upgraded Unity to 2019.3.8f1 with great difficulty, and Android outpackage students have also successfully outpackage online. Results according to operation feedback, some players could not start the game and reported an error of “Failed to load il2cpp“, as shown in figure

, which had never been encountered before.

later after considering this is the upgrade of problem, think either Unity version of the bug, caused by improper or upgrade .

at that time, the latest version of Unity had arrived at 2019.3.14f1. I looked through the release note after 3.8 and found that none of them mentioned this kind of bug. Baidu Google search mentioned about this problem also said in 2019.3.0A has been solved.

, after communicating with the classmate of Android package, I found that the version of NDK is not recommended by Unity. There is a note above, as shown in figure
, which means that the current version of Unity only supports NDK 19.0.5232133. With “Finally found the problem!!” Check the NDK version of his Unity, the result is 19.0.5232133. I could only have left resentfully, but the Android classmate claimed that the NDK version he used for Android Studio was still NDK R14. Yes, that’s it. That’s it.

Caused by: com.android.builder.dexing.DexArchiveBuilderException: Failed to process D:\….\0.jar

first solution:

adds this dependency to android in build.gradle of a project:

compileOptions {
    targetCompatibility JavaVersion.VERSION_1_8
    sourceCompatibility JavaVersion.VERSION_1_8
}

second solution:

add a configuration in the defaultConfig configuration under android in the project’s build.gradle file:

multiDexEnabled true

the third solution is the one I want to share with you most, because this error report I tried a lot of methods, but it still doesn’t work, and finally because the JVM allocation mechanism memory space caused by the compilation error

add this sentence under gradle.properties for the project:

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8


Execution failed for task ‘:app:mergeDebugResources’.

I encountered the following compile error in my project today. The error message is as follows:

org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDebugResources'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
    at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
    at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
    at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
    at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
    at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196)
    at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
    at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
    at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
    at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: com.android.build.gradle.tasks.ResourceException: Error: Some file crunching failed, see logs for details
    at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:166)
    at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:88)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
    at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76)
    ... 81 more
Caused by: Error: Some file crunching failed, see logs for details
    at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:272)
    at com.android.ide.common.res2.DataMerger.mergeData(DataMerger.java:301)
    at com.android.ide.common.res2.ResourceMerger.mergeData(ResourceMerger.java:410)
    at com.android.build.gradle.tasks.MergeResources.doFullTaskAction(MergeResources.java:159)
    ... 92 more
Caused by: java.lang.RuntimeException: Some file crunching failed, see logs for details
    at com.android.builder.png.QueuedCruncher.waitForAll(QueuedCruncher.java:293)
    at com.android.builder.png.QueuedCruncher.end(QueuedCruncher.java:314)
    at com.android.builder.internal.aapt.v1.AaptV1.end(AaptV1.java:375)
    at com.android.ide.common.res2.MergedResourceWriter.end(MergedResourceWriter.java:269)
    ... 95 more

see such a long string of stack information, I completely messy, not a useful sentence! And for the record, the reason why this is a problem is that when you build Gradle, Gradle will check to see if it has changed the suffix of the file; This problem occurs when.jpg changes to.pNG. This problem may also occur in the 9patch image, such as the 9patch image when it is not the 9patch image. Modify the correct image format (if it is not a 9patch image, make 9patch with the tool, which comes with the SDK is recommended).

Developing in Android java.net.SocketException : socket failed: eacces (permission denied) reported an error

in the android development java.net.SocketException: socket failed: EACCES (Permission denied) error

knowledge point:

1, SocketException network operation error;

2. Solutions; (turned out to be a single user to close our app networking permissions, now new android system can be set for a permission)

today I met a user feedback, is that the problem encountered, click login, but unable to login, but prompt java.net.SocketException: socket failed: EACCES (Permission denied) this information. The first reaction is lack of network access, and then hurriedly check whether to join the network access.

adds

to the androidmanifest

<uses-permission android:name=“android.permission.INTERNET”/>

However, I already wrote it in the program. It’s rare to write an Android app project that doesn’t connect to the Internet, so this should be included in the first place. So, this problem is eliminated. However, I found a lot of information, but did not find a suitable description and solution. It can’t be me.

so here are some of the possible reasons I’m looking for.

but I don’t have the user’s phone, otherwise the log error will be clear. Now you have to ask the user to download the app again. And then it’s OK. This is a real pain in the ass.

There’s a new possible issue: users have disabled your app’s access to the network. Notice that it’s a single block. So give your application access to the Internet based on the system.

For example, the operation of xiaomi mobile phone is: find the “security center” app, enter, and then see the “network assistant”, enter, and then click “network control”, find the corresponding app, check whether the corresponding “data” and “WLAN” options are hooked.

or

Java file network operation, add the following code

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectDiskReads().detectDiskWrites().detectNetwork().penaltyLog().build());

reason:

is most likely because the code for the possible network operation was written in the UI thread, which has not been allowed since android 4.0. Because network operations are done in the UI thread, if the network is bad then the whole program is easy to ANR. So android4.0 will have to open a new thread for code that wants to operate on the network.

or

network permissions are written like this:

<uses-permission android:name=“android.permission.INTERNET"/>

instead of writing

<permission  android:name=“android.permission.INTERNET"></permission>

or

important – the uses-permission tag needs to be before the application tag in the manifest file. thats what fixed it for me at least.

outside the wall say: permissions to be in < application> Only when the tag is introduced can it work. (but I write that all the time, no problem) — get rid of

or

after you restart the ide, you can run the code normally again.

total reason:

lack of permissions?

permission error?

network operation in UI thread?

port occupation caused?

android version issues?

development tool problem?Restart and recompile

Genymotion runs the arm program, install failed no matching ABIS failed to extract native libraries res = – 113

Genymotion is not supported by arm library, resulting in an error when running an app that calls so library:, install failed no matching abis failed to extract native libraries res = -113. Online to find the solution for many, finally found that requires a file, pulled apart, and version can’t too low https://pan.baidu.com/s/1jJRueYa (here 5.1.1 versions of the note with their corresponding versions of the virtual machine)

There’s another solution to

:

splits {
    abi {
        enable true
        reset()
        include 'x86', 'armeabi-v7a','x86_64'
        universalApk true
    }
}

but I don’t understand this code, and this is a machine problem, don’t use code to solve, so I use the first method

another way is to use real machine debugging

ADB remount failed: operation not permitted

adb remount failed: Operation not permitted problem resolved

go to console and execute # echo “enable 0;” > The/proc/alog can

or for the yaffs2 file system

# mount -o rw, remount-t yaffs2 /dev/block/mtdblock3 /system
# chmod 777 /system
# chmod 777 /system/lib

or for an ext4 file system

# mount -o rw, remount -t corruption/dev/block/mtdblock3/system
# chmod 777/system
# chmod 777/system/lib

Android Studio: Application Installation Failed (How to Fix)

using Android Studio to run programs on emulators reported this error, there are many reasons for this problem, so there are many solutions, here are some mainstream solutions to solve most of the problems.

Installation error: INSTALL_FAILED_NO_MATCHING_ABI.

Installation error: INSTALL_FAILED_NO_MATCHING_ABI. For this case, please refer to the following Installation error: INSTALL_FAILED_NO_MATCHING_ABIS

scheme 2: it may be that an app with the same name was originally installed on the simulator (mobile phone) but the signature is different, so just delete the app on the mobile phone.

scheme 3: click build-& gt; Clean Project, then Build-> Rebuild Project is sufficient.

scheme 4: click File-> Setting-> Build,Execution,Deployment-> Instant Run, will enable Instant Run... The check for is removed.



Welcome to join the QQ group for discussion.
YinyouPoet – YinyouPoet

Install of Android studio_ FAILED_ OLDER_ Solutions to SDK

Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK
The application’s minSdkVersion is newer than The device API level.


means that the SDK version of the device I am using is lower than the required SDK version

solution:
find the project location
project location \app\build. Gradle
note that it is under the app folder, not the well-known one (under the gradle folder)

, minSdkVersion
, minSdkVersion
, minSdkVersion set the range is 14-16,
and targetSdkVersion I test from 1 to 10000 no problem, but still do not suggest to randomly change
according to the personal computer Settings are different, don’t ask me how I got this range, I tried for a long time

specific version number is as follows

android {

compileSdkVersion 29
buildToolsVersion "29.0.3"

defaultConfig {
    applicationId "com.example.myapplication"
    minSdkVersion 15
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

gradle version is the latest 3.6.0


this time reminds me of the time when I used a very low version and could not be automatically updated to the latest version. I could only install the tesorflow library from the PIP on the official website, which was not suitable for the 3.7 version. As a result, I reinstalled two versions of python, including 2.0 version but not 3.6 version