Tag Archives: android

Solution to the error of “may missing Internet permission” in Android

Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>

Permission denied (may missing Internet permission) error resolution

This is a classic error, socket can not be external connection, error will not be reported, debugging, you can see exception.

The reason is: you need to access the network, so in androidmanifest.xml, you need to configure as follows:
& lt; manifest>
// add the following license

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

</ manifest>

The relevant visual configuration can be added through eclipse’s XML visual editing tool

Note: some input files use or override a decrypted API

This article is reproduced from: http://blog.csdn.net/lilidejing/article/details/46564491

Enter the system framework layer, modify the source code of mediaplayer.java, and add a method. As a result, recompile the system and report the following error:

[java]

view plain

copy

………………

N ote:SomeinputfilesuseoroverrideadeprecatedAPI.

N ote:Recompilewith-Xlint :deprecationfordetails.

6warnings

Then go to mediaplayer. Java and restore the modified file. The result is compiled and passed. The key is that I need that method

The final solution: enter the Android directory and execute the make update API

After execution, recompile and pass

Android Mobile Error: remount failed: Operation not permitted

remount failed: Operation not permitted

1. Make sure the phone is connected correctly

adbdevices

2. Enter the shell

adbshell

3. Input the command in the shell (the # sign at the front of the command does not need to be input)

#su

#mount-orw,remount-tyaffs2/dev/block/mtdblock3/system

#chmod777/system

#exit

4. Then you have read and write permission to the system directory. For example, you can use ADB push to push files to the system directory, or delete system files

 

If you don’t have the Su permission, please select root by yourself first

AndroidStudio Error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:proces

Android studio compile error

org.gradle.api.tasks.TaskExecutionException: Execution failed for task
':app:processDebugResources'.

Android resource compilation failed Output:  
D:\company\SuperMarket\app\build\intermediates\incremen

Caused by: org.gradle.tooling.BuildException: 
Failed to process resources, see aapt output above for

Process 'command 'C:\SDK\build-tools\28.0.3\aapt.exe'' 
finished with non-zero exit value 1

Let’s start with an experience. This kind of problem is often the XML file.

How to locate the problem
open the terminal of Android studio and enter the command on the command line: gradlew compiledebugsource -- stacktrace - info or gradlew assembledebug -- info or gradlew assembledebug

Mac Linux system input:./gradlew compiledebugsource — stacktrace – info

Then you can view the specific compilation report information on the command line. There are many compilation contents. If you look down patiently, you will find a very obvious error prompt:

the file and reason of the error are very detailed.

At the bottom of the compilation information is the error information of the build window

...
D:\company\SuperMarket\app\src\main\res\layout\item_c_day_manager_layout.xml:51:46-61: AAPT: No resource found that matches the given name (at 'layout_constraintLeft_toRightOf' with value
 '@id/tv_work_num').
...

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugResources'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        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
		...

Android didi 16: a possibility of unable to start service intent

Program error:

Unable to start service intent read a lot of online posts and said that the service was not registered, which is right. But there is also a very low-level error, that is, when you start intent, you mistakenly write startactivity() as startservie(). I would like to say that this is a very low-level mistake, but I made it today and spent a whole morning debugging it, AI ~ next time, have a long memory

Connect unity profiler to Android real machine for debugging

Profiler can watch the performance consumption in editor mode, but after all, the computer configuration is high, which is different from the real mobile environment. It is recommended to use real machine test for optimization in actual development

Because the IOS configuration is generally higher than that of Android mobile phones, optimization on Android platform is generally not a big problem in IOS. The following describes how to connect profiler to Android real machine for debugging

A profiler monitors unity’s packets to run directly on the phone

1 Android device settings:

Mobile phone open developer mode and USB debugging

2 building settings

(1) switch to Android platform

(2) select internal for build system

(3) building setting check development build, Autoconnect profiler, script debugging. Click building and run. After the package is successful, the program will run

(4) add open scenes add the scene to be tested as the current scene

3 package:

Connect the Android device to the computer with USB cable, and click build & amp; Run. After packaging, click the required authorization information on the Android device to make the program run on the Android device

4 profiler monitoring:

(1) after packaging, unity will automatically open the profiler window. If the program on Android device is running but does not automatically open the profiler window, click window – > Profiler open manually

(2) in the profiler window, click editor, click Android player (ADB..), select monitor Android device, and select record to start monitoring

  

Second, profiler monitors other programs

① Mobile phone open developer mode and USB debugging

② Open the CMD command-line tool, CD to the directory of adb.exe in the SDK, and mine is in E::?Android?Android?SDK?Windows?Platform tools

Then type ADB forward tcp:34999 localabstract : unity package name, such as ADB forward tcp:34999 localabstract :Unity-com.company.product。

③ Window-> Profiler, select Android player( [email protected] : 34999), select record to start monitoring

If you can’t connect during the test

Make sure that the firewall doesn’t block the port we want to connect to

2 error: failed to connect to player IP: 127.0.0.1, port:34999 Solution: when packing, check enable internal profile in player setting

[my advanced journey to Android] solve the problem that some Android 8.1 models get the WiFi name empty, WiFi info. Getssid empty or < unknown SSID >

1、 Requirement description

Recently, we need to make a requirement to determine whether the Android device is connected to the WiFi with the specified name before doing a certain business. If you are connected to the WiFi with the specified name, you can continue a service; Otherwise, skip to settings to connect to the WiFi with the specified name

Therefore, I need to obtain the WiFi name of the current Android device connection for business logic judgment

2、 Implementation method

Before implementation, you need to add corresponding permissions

First of all, it’s necessary to obtain permissions. Those above 8.0 should be added in Android manifest

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

Execution failed for task ‘:app:checkDebugDuplicateClasses‘.

Problem
Android Studio compiles with the following error.
Execution failed for task ':app:checkDebugDuplicateClasses'.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class com.tencent.ijk.media.exo.BuildConfig found in modules jetified-LiteAVSDK_Player-7.5.9307-runtime.jar (com.tencent.liteav:LiteAVSDK_Player:7.5.9307) and jetified-LiteAVSDK_Player_7.5.9307-runtime.jar (:LiteAVSDK_Player_7.5.9307:)
  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.


* 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 1m 34s
155 actionable tasks: 155 executed

reason

Relying on duplicate resource files, for example:

The a.aar file is imported into lib , and then the same a file is relied on in build. Gradle . It depends on two different resource files, but they contain the same content.

Solution

Remove the duplicate resource files.