Tag Archives: Android

Solution for error 7 in lineage OS brush

The test model, the Nexus 6P

    brush steps
    Power key + volume button to enter rec mode to choose the wipe can be removed, in addition to the internal storage (installation package on the inside) wipe after success, return to the interface select install select flash in the install package directly open the brush if ERROR7 mistakes, returned to the main interface, select the mount, cancel and then began to brush in front of the system) can generally in just after entering the rec interface, click the mount interface, will find that in front of the system not check the number, In other words, there is no mounted system, but when you enter mount again after sanqing, you will find that the system is mounted, cancel the check sign in front of the system, and then go to install to remove the error 7

How to share a process among multiple apks

By default, all components in the same application run in the same process, and most applications do, too. However, if we want to control that a particular component belongs to a process, we can configure it in the manifest file.
In the manifest entry for each component element (activity, service, receiver, provider), a “android:process” property is supported, which allows you to specify the process that a component is running. You can set this property so that each component runs in its own process, or you can have only certain components share a process. We want to be able to set the “Android: Process” property so that components in different applications, which share the same Linux user ID and have the same certificate, run in the same process.
< application> The element also has an “Android: Process” attribute that can be set to a default value that applies to all components.
When the amount of available memory is low and some processes that interact with the user in real time need memory, Android can terminate a process at any time. Components running in the terminated process are destroyed, but a second process is started when the components are needed to work again.
In deciding which processes to terminate, The Android system weighs their importance to the user. For example, it makes more sense to terminate a process running invisible activities than a process running visible ones. Whether or not to terminate a process depends on the state of the components that are running in the process.
If two activities cannot be placed in the same application, they can be forced to run in the same process by setting the following properties in their manifest, thus taking full advantage of the Shared resources within the process and reducing the memory footprint:
Java code:
(1) Set the same User Id:
2.< manifest android:sharedUserId=”aaa.bbb”
3. (2) The called activity sets the following properties:
4.< activity android:multiprocess=”true”
Or 5.
6.< activity android:process=”com.cienet.test”
For 3D OpenGL program, after modifying the above attributes, the memory footprint of the called activity will be significantly reduced, such as: 30MB-& gt; 2 MB.
You can do the following test: How do you share a process
Java code:
1. Join Android :sharedUserId=” AAA. BBB “no
2.android:process=”com.cienet.test”
3.07-12 15:42:34. 781: the ERROR/Dean (7615) : Binder. The getCallingPid (7615)
4.07-12 15:42:34. 785: the ERROR/Dean (7615) : runningappprocessinfo. Pid: 7615 runningappprocessinfo processNamecom. Cienet. Testa
5.07-12 15:42:34. 785: the ERROR/Dean (7615) : pkgname: 7615: com. Cienet. Testa
6.
7.
8.07-12 15:42:24. 722: the ERROR/Dean (7602) : Binder. The getCallingPid (7602)
9.07-12 15:42:24. 726: the ERROR/Dean (7602) : runningappprocessinfo. Pid: 7602 runningappprocessinfo processNamecom. Cienet. Testb
10.07-12 15:42:24. 726: the ERROR/Dean (7602) : pkgname: 7602: com. Cienet. Testb
11.
12. Add Android :process=”com.cienet.test” to B
13.
14.07-12 15:46:41. 933: the ERROR/Dean (7738) : Binder. The getCallingPid (7738)
15.07-12 15:46:41. 937: the ERROR/Dean (7738) : runningappprocessinfo. Pid: 7738 runningappprocessinfo processNamecom. Cienet. Test
16.07-12 15:46:41. 937: the ERROR/Dean (7738) : pkgname: 7738: com. Cienet. Testb
17.
18.07-12 15:47:13. 246: the ERROR/Dean (7761) : Binder. The getCallingPid (7761)
19.07-12 15:47:13. 246: the ERROR/Dean (7761) : runningappprocessinfo. Pid: 7761 runningappprocessinfo processNamecom. Cienet. Testa
20.07-12 15:47:13. 250: the ERROR/Dean (7761) : pkgname: 7761: com. Cienet. Testa
21.
22. Add Android :process=”com.cienet.test” to A
23.
24.07-12 15:50:24. 988: the ERROR/Dean (7878) : getApplicationInfo: publicSourceDir/data/app/com. Cienet. Testa – 1. The apk
25.07-12 15:50:24. 988: the ERROR/Dean (7878) : getApplicationInfo: descriptionRes0
26.07-12 15:50:24. 988: the ERROR/Dean (7878) : Binder. The getCallingPid (7878)
27.07-12 15:50:24. 992: the ERROR/Dean (7878) : runningappprocessinfo. Pid: 7878 runningappprocessinfo processNamecom. Cienet. Test
28.07-12 15:50:24. 992: the ERROR/Dean (7878) : pkgname: 7878: com. Cienet. Testa
29.
30.
31.07-12 15:50:46. 964: the ERROR/Dean (7878) : getApplicationInfo: publicSourceDir/data/app/com. Cienet. Testb – 1. The apk
32.07-12 15:50:46. 964: the ERROR/Dean (7878) : getApplicationInfo: descriptionRes0
33.07-12 15:50:46. 964: the ERROR/Dean (7878) : Binder. The getCallingPid (7878)
34.07-12 15:50:46. 968: the ERROR/Dean (7878) : runningappprocessinfo. Pid: 7878 runningappprocessinfo processNamecom. Cienet. Test
35.07-12 15:50:46. 972: the ERROR/Dean (7878) : pkgname: 7878: com. Cienet. Testa
36.
37.
38. Remove the android: sharedUserId = “aaa. BBB”
39.07-12 15:52:29. 574: the ERROR/Dean (7967) : getApplicationInfo: publicSourceDir/data/app/com. Cienet. Testb – 2. Apk
40.07-12 15:52:29. 578: the ERROR/Dean (7967) : getApplicationInfo: descriptionRes0
41.07-12 15:52:29. 578: the ERROR/Dean (7967) : Binder. The getCallingPid (7967)
42.07-12 15:52:29. 578: the ERROR/Dean (7967) : runningappprocessinfo. Pid: 7967 runningappprocessinfo processNamecom. Cienet. Test
43.07-12 15:52:29. 578: the ERROR/Dean (7967) : pkgname: 7967: com. Cienet. Testb
44.
45.
46.07-12 15:53:06. 730: the ERROR/Dean (7990) : getApplicationInfo: publicSourceDir/data/app/com. Cienet. Testa – 2. Apk
47.07-12 15:53:06. 730: the ERROR/Dean (7990) : getApplicationInfo: descriptionRes0
48.07-12 15:53:06. 730: the ERROR/Dean (7990) : Binder. The getCallingPid (7990)
49.07-12 15:53:06. 734: the ERROR/Dean (7990) : runningappprocessinfo. Pid: 7990 runningappprocessinfo processNamecom. Cienet. Test
50.07-12 15:53:06. 734: the ERROR/Dean (7990) : pkgname: 7990: com. Cienet. Testa
As shown above that APK Shared process requires two conditions (1) to set the same User Id:
(2) The called activity sets the following properties:
< activity android:multiprocess=”true”
or
< activity android:process=”com.cienet.test”

package R does not exist

This error is usually the result of not writing or incorrectly writing the package name in the source file. Note that this error is consistent with the package name in the Androidmanifest.xml.

no target device found problem solved

In the process of developing apps with Android Studio, I believe everyone has encountered this problem. However, I have read some answers on the Internet and failed to solve the problem. Therefore, I have checked again myself.
Start by selecting Run from the Top navigation bar of Android Studio, as shown in the figure

Then open Edit Configurations… , the following options appear, as shown in the figure

Select the first one here

And then at this point, run the APP, click Run, and the following one will appear, as shown in the figure

Congratulations, now your virtual machine, or real machine, is out!!
If this interface does not come out, you can choose to restart the simulator or re-plug the UB real machine, and it will come out. Thank you for watching. I hope it helped you

How to Fix Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!

Unknown error: to the dx.jar the SDK folder! Recently, I gradually migrated to Android Studio. After updating the Android SDK Manager, I opened the Eclipse Run project and reported an error. Search for various solutions and find:
The version of Android SDK build-Tools has been higher than the version of Android SDK platform-tools, as shown in the figure

Since Android Studio sometimes has to use the higher-version build-Tools, simply deleting the higher-version build-Tools won’t do (see Unknown Error: to the dx.jar the SDK Folder! Solution).
Finally, the relevant answer is found on Stack Overflow (Android ADT Error, was not loaded from the SDK Folder), and the modification is shown in the figure:

Add sdK.buildTools = the build Tools version already installed on your computer

Can.Close test:
Target = android – 24.
SDK buildtools = 25.0.3
Effective!!!!!

You can also avoid this problem by simply deleting the latest 26.0.0 and 27.0.0 folders

Error receiving broadcast Intent { act=com.supersdk.listen.PayListen_defeat flg=0x10 (has extras)

After sending the broadcast, the redirect activity problem torched over a day.

At first I thought it was a repeat broadcast. Didn’t solve.
Then see under Caused by: Java. Lang. An IllegalStateException: Can not perform this action after onSaveInstanceState
Life cycle issues. I know why
After the broadcast the activity is on the edge of being killed in some scenario, the system calls the onSaveInstanceState method, which calls the FragmentManager saveAllState method, saves the state of the fragment, and after the state is saved, the user actively calls onBackPressed, The method’s superclass super.onbackPressed determines if the FragmentManager has saved state and throws an exception for IllegalStateException if it has. Then the activity cannot be found when the broadcast is received
It’s easy: let me rewrite it
Override
protected void onSaveInstanceState(Bundle outState) {
// TODO auto-generated method stub
}

Session ‘app’: Error Installing APKs

Problem description:
The new Android project in Android Studio, running on the real phone through the data cable, can see the default home page of the project. However, after hosting the project using the code cloud, the Clone project is imported into Android Studio to try again to run on a real phone. Here, the above Session ‘app’: Error APKs was found in the Event Log
Solutions:
build –clean project

Supplement to the problem of “Session’app’: Error Launching activity” when running on Android

As for the problem of “Session ‘app’ : error-Launching Activity”, there are two online solutions, but none of them can launch my own

The basic solutions are

    File-> Settings-> Build, Execution,Deployment find Instant Run and remove the pre-instant Run option from tools-& gt; Android -> Sync Project with Gradle Files

Another is that the APP seems to be uninstalled, and the icon can’t be found on the desktop of the phone, but there is still caching; Open the command line directly

adb shell pm uninstall <YourAppPackageName>

Use the command to unload residual applications.


The 2019-10-28 supplement
The command line mentioned above still has some problems in the case of multiple users in the system, which may lead to unclean uninstall, too low version number or inconsistent signature, resulting in the new APK can’t be installed, and can’t be installed when using Android Studio to directly run. At this point, we can adjust the version number to a large number, and then repackage, with adb install XXX to cover the installation; Install successfully, then manually uninstall, then go to run is OK. More operational references

adb shell 
pm --help

Error running app: Default Activity Not Found



click on the run button and make a mistake

this is a mistake that many Android developers should have encountered, and the solution is not the same. But my solution might be a little odd, and it might help you. After this problem occurred, I tried the following solution.
First, check whether the launch page in Androidmanfest.xml is configured
This is beside the point because mine is already configured
Second, set the Launch Options to Nothing in Run/Debug Configuarations
If there is no problem with plan 1, open Run/Debug Configuarations

and select Nothing — > The Apply – & gt;

this time run without error, and successfully installed into the phone, but… I didn’t launch my App after it was installed successfully. How could I launch it for you when everything was configured as Nothing?Obviously, it does not meet my requirements (when the project is very urgent, the result of this project has been very good, so we can give priority to the completion of the project and solve this problem later).
Scenario 3: Reset Android Studio
Delete.androidStudio4.0 from the directory “C:\Users\ user name” (maybe yours is another version), restart AndroidStudio and wait for the miracle, mine is still the same ghost, not solved.
Plan 4: Reinstall Android Studio
Also still be that ghost kind, fail to solve. Is it a project problem?But my colleague’s work is going really well. Finally, if you’ve reached this point, see if you can solve your problem, which is how I solved it. If not, please add plan 6 in the comments section, I am too weak.

Create a new Activity and set it to Launch Activity


. Then select the Launcher Activity — > Finish, wait for Gradle synchronous

then AndroidManfest files in the start page changed back into before start page