Tag Archives: android studio

Solve the problem of Android studio running time e rror:java.lang.NullPointerException (no error message) error

With multi-dimensional model as the core, let the factory digital transformation and upgrading “within reach”>>>

Original text:

Solve the problem of Android studio running time e rror:java.lang.NullPointerException (no error message) error

Today, I encountered a problem. The computer suddenly shut down, and then restart the computer. When I turn on Android studio, I can’t run the program, and then I report

Gradle tasks Error:

E rror:java.lang.NullPointerException (no error message) error

Then I clean, rebuild are useless

Final solution:

Delete the. Gradle file in the project directory and restart Android studio. Delete the. Gradle file instead of the build. Gradle file

The solution of failed to install Intel haxm error in Android studio installation

After chopping hands, the fraud call came before the express delivery was received. How to improve the privacy and security of e-commerce>>>

1. Problem analysis

It can be seen from the following that the installation of Intel haxm failed. Please check haxm_ silent_ Run. Log

(1) let’s know what Intel haxm is first

Intel represents Intel, and the whole process of haxm is hardware accelerated execution manager, that is, hardware accelerated execution manager. Intel haxm is Intel’s hardware accelerated execution manager, which is a hardware assisted virtualization engine (hypervisor) that can use Intel virtualization technology (VT) to speed up Android development. AMD CPU can’t be installed. Control hardware is added to the CPU. When VT is turned on, some analog instructions (or some new basic instructions) are started to speed up the calculation and reduce each cycle to achieve the optimization effect. When haxm is turned on, the speed of Android simulator will increase significantly

Perhaps the above terms are too professional. It is generally understood that Android simulator has always been known for its slow running speed. Intel haxm technology is used to accelerate the Android simulator to make the running degree of the simulator comparable to that of the real machine and completely solve the problem of slow running of the simulator

(2)haxm_ silent_ Run.log log analysis

It can be seen from the following that haxm will be used in program installation, but Intel virtualization technology (VT-x) is not turned on, and haxm cannot be installed successfully before (VT-x) is turned on. So the next work is how to turn on Intel virtualization technology (VT-x)

2. Solve problems (open Intel virtualization technology (VT-x)) 2

(1) On the Internet, we can find that Intel virtualization technology (VT-x) will be in the BIOS, so we need to enter the BIOS to start the operation of Intel virtualization technology (VT-x)

(2) what is BIOS

BIOS is the acronym of the English full name “basic input and output system”, which is interpreted in Chinese as: computer basic input and output system; The design and development personnel write and solidify the configuration information of computer hardware in the BIOS chip of the motherboard in advance. These information include the basic input and output program, the basic information of hardware, the sequence of self checking program when the computer starts, the necessary startup program of the computer, etc. BIOS settings provide the most original, the lowest and the most direct basic information for the computer, It is the basis to help the computer to provide services for users
(3) the computer enters the BIOS

when the computer can be turned on normally

Press * * to enter setup will appear in the lower left corner of the screen when the computer is turned on

abnormal startup

(3) turn on Intel virtualization technology (VT-x)

In general, in the configuration option, but also in the security option

Problems and solutions of Android studio importing new projects

Yesterday, I imported a previous project from Android Studio itself, and there was no display problem when compiling, but the following dialog box was displayed when running:

Installation failed with message Invalid File: C:\2ld\serialdemo20170224g2\serialdemo20170224g2\serialdemo20170224g\app\build\intermediates\split-apk\debug\slices\slice_1.apk.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

After clicking Ok to close the dialog, the lower left corner displays:

Session ‘SerialTest’: Error Installing APK s

No error log at all

Solution:

Turn off instant run , in file-setings…-build, execution, Deployment-instant Run. After closing, re-run the project, still error, then there will be an error log.

01-01 20:21:26.519 707-707/com.jspdz.zw2.serialdemo E/AndroidRuntime: FATAL EXCEPTION: main

 

Process: com.jspdz.zw2.serialdemo, PID: 707
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jspdz.zw2.serialdemo/com.jspdz.zw2.serialdemo.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method ‘int com.jspdz.zw2.serialdemo.SerialCommand.PCD_M1Read(short, byte[])’ on a null object reference

 

 

It turned out to be an error caused by a null pointer and the class was not instantiated.

Android Studio Real machine failed to run: Installation failed with message Invalid File…..

I often encounter Android Studio pop-ups when running Android projects on some real machines:

Installation failed with message Invalid File: K:\project\app\build\intermediates\split-apk\with_ImageProcessor\debug\slices\slice_0.apk. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

After clicking OK, it shows Session ‘app’: Error Installing APK failed to run at the bottom left.

Solution:

Step 1: ClickBuildtab —>Clean Project

Step 2: ClickBuildtab —>Build APK

Step 3: Run.

Solution!

Android Studio Error: Application Installation Failed…INSTALL_FAILED_INVALID_APK…

Android studio’s three mistakes come down to one

1. Pop up the window with the following error

Application Installation Failed…INSTALL_ FAILED_ INVALID_ APK…
WARNING: Uninstalling will remove the applation data:
Do you want to uninstall the existing applation?

2. Event log, the error is as follows

Session ‘app’: Error Installing APKs

3. Run, the error is as follows

Unknown failure (Failure – not installed for 0)
Error while Installing APKs

These three errors can be summed up in one, which also debugged for several hours for various searches. Finally, we found a way:

It can be solved in setting: File — > Settings

Solutions to the problem of Android studio pulling mpandroidchart always reporting gradle sync failed: could not download javassist.jar

The error that will be displayed in the Log log is org.gradle.internal.resolve.ArtifactResolveException:Could not download javassist.jar (org.javassist:javassist:3.20.0-GA);

solution:

build.gradle change  jcenter() to maven { url "http://jcenter.bintray.com" }

ubuntu18.04 Start Android StudioKVM is required to run this AVD ./dev/kvm device: permission denied.

Install Android studio under Ubuntu 18.04, and report an error after installing the simulator

KVM is required to run this AVD. /dev/kvm device: permission denied.

That is, the current user has no permission to/dev/KVM, so the/dev/KVM file needs to configure the permission group to the current login account. The terminal configures the following commands

sudo chown g -R /dev/kvm

In order to configure the command automatically, we need to follow the way of configuring Java environment variables. Configure it in the. Bashrc file so that it can be started automatically

( the following operations should not be needed. After using the sudo chown command to restart, you do not need to change the permission of this file again, because it has been set)

if you want to know how to add sudo (root permission) command when starting up, please see : start sudo command when Linux starts up

Configuration method:

sudo vim ~/.bashrc

On the last line of the file, add the following code. Add the file/dev/KVM to the permission group of redkey (my account)

sudo chown redkey -R /dev/kvm

In this way, after restarting the computer , the configuration information will be automatically executed

Android studio real machine test failed — “no target device found”

Reference article:

https://blog.csdn.net/chang_ sir/article/details/51755572

Today, I want to test a program with a real machine, but I report such a error “no target device found” . After checking, the machine has been successfully connected. And my edit configurations.. — > Deployment Target Option –> Target has been set to USB device. Why did it report that the target device was not found

1. It is preliminarily estimated that the last time I modified the project, it may not be closed normally, or there may be a conflict when modifying the configuration. In short, it can’t be used. There is a problem. Refer to the article mentioned above, and finally it is solved. The first step is to ensure the physical connection between the mobile phone and the computer

2. Click the Android device monitor button

Make sure that your device is online. If your device is not displayed, it means that the Android monitor program has not been started and cannot recognize the device connected by the USB cable. Don’t worry at this time. This is a normal phenomenon. The solution is also very simple. Find the View menu button, which is a small inverted triangle. There is a Reset ADB option in the drop-down menu. Click it and you will find that your device is online

For my project, I can operate normally when I return to the main interface, which proves that the error has been fixed