Tag Archives: Android studio

[Solved] Android Studio Compile Error: Invalid main APK outputs : EarlySyncBuildOutput

Invalid main APK outputs : EarlySyncBuildOutput(type=com.android.build.gradle.internal.scope.InternalArtifactTypeKaTeX parse error: Undefined control sequence: \work at position 65: …on=0, output=F:\ ̲ w ̲ o ̲ r ̲ k ̲\ MobileWMS\app\… [email protected] , apkType=MAIN, filtersData=[], version=0, output=F:\work\MobileWMS\app\build\outputs\apk\debug\output-metadata.json)

An error is reported when the version is too low. An error is reported when compiling again
after modifying the gradle version, an error is reported when compiling again, which is caused by the previously compiled APK

Solution:
Click clean project under the build directory to clear the previously compiled data

clear and then compile!

Android gradle reports an error

Another error was reported during Android development. This is a version error. The first step is to synchronize the versions
error message:
Android studio error: gradle project sync failed. Please fix your project and try again

1. Version synchronization:

1.1 file> sync project with android gradle

If you succeed, you don’t have to look at the following

1.2 error reporting:

It can be seen or not solved:

It should be the version problem. If we can’t download it, we can download it directly manually (check the network first, and the agent has no problem, but it still can’t be solved)

2. Modify proxy parameters:

Agent:

2.1 open file & gt; setting> Search proxy

2.2 configuration information

The address and port of the agent shall be filled in as follows:

URL: http://127.0.0.1:1080/pac

2.3 check whether the Ping is connected

    use check connection

      enter a website to test: www.baidu.com, and then test:

      Still not!

      3. Manual Download

      So let’s continue:

      3.1 open the gradle wrapper properties file

      3.2 download

      Download the gradle in the last line of the website. Note that the version must be consistent. Download whatever he puts down.

      3.3 modifying environment variables

      Remember to modify the gradle environment variable in the computer:

        system environment variable:

          path:

        3.4 modify the compilation environment configuration

        Then unzip it, modify the gradle configuration in the environment, and it’s OK.

        You can see that my environment is OK now:

[Solved] Flutter Amap plug-in amap_location error: AmapLocationPlugin.java:287: error

1. Foreword

Plug in amap in use_ The location suddenly reported an error today. The project cannot run. The error prompt is as follows:

2. Error prompt

.../amaplocation/AmapLocationPlugin.java:287:Error: Unreported exception error Exception; it must be caught or declared in order to throw locationClient = new AMapLocationClient(getApplicationContext());

3. Cause investigation

After modifying the one-to-one communication without results and one-to-one search for information, I accidentally saw the discussion in the group and knew that it was caused by the problem of privacy policy. The temporary solution is not to use the latest Gaode com.amap.api: location. The latest privacy policy is available. The best solution should be to access the latest policy, which has not been implemented

4. Solution

1. Find AutoNavi’s amap_location package according to the above path, in flutter/.pub-cache/hosted/…, and copy it after getting it, and change the latest dependency in android/build.gradle. At present, I Here is changed to 5.5.1


2. Delete the example in the package, create the local plug-in file plugins in the project, put the plug-in package into yaml, and import the local plug-in

Execute pub get, the error disappears, and the project can run

Android studio does not prompt error messages [How to Solve]

Solution

1.After the as is upgraded, it is set to the power saving mode by default. If it is set to the power saving mode, the as will disable many auxiliary functions to achieve the purpose of power-saving. Therefore, automatic code prompt and error prompt are also prohibited.

Turn off power saving mode: File—> Remove the tick √ in front of power save mode

2.Your Android studio has installed the plug-in of butterknife. Open file — > Setting—> Plugins—> Find butterknife — > Right-click uninstall delete to uninstall and restart it. After restarting studio, open the project. It’s ok because now butterknife is no longer used. It is recommended to use viewbinding.

Solutions to errors in virtual machine running in Android studio

When starting the virtual machine in Android studio, there may be an error message in the “event log” of the main interface. At this time, the virtual machine can still run.

1. Solution to failed to open/qemu.conf

“Emulator: error | failed to open/qemu.conf, err: 2” (Figure 1 ②) is displayed in “event log” (Figure 1 ①), and the error message is “failed to open qemu.conf file”.

1.1 qemu.conf file

QEMU is a set of simulation software that can simulate another set of operating system in Windows operating system. Because it can simulate a virtual CPU in the system, and then hand over the operating system to be simulated to the virtual CPU for processing, it can achieve the purpose of executing two operating systems on the same platform at the same time.

Qemu.conf is the configuration file of Android studio virtual machine. When the virtual machine starts, you need to read the information of the configuration file. By default, the configuration file is in the root directory of drive C.

1.2 solutions

Create qemu.conf file in the root directory of drive C. First, open “this computer” on the desktop, click “view” in the toolbar (Figure 2 ①), and then select “file extension” (Figure 2 ②). The purpose of this operation is to display the file extension so that the file extension is changed to “conf”.

 

Figure 2 shows the file extension

Then, create a new text file in the root directory of drive C and rename it “QEMU. Conf”, as shown in Figure 3.

Figure 3 qemu.conf file

Run the simulator again at this time, and the above error prompt will not appear again.

2. Solution to unexpected system image feature string

When the simulator is running, “emulator: warning | unexpected system image feature string. Emulator may not function correctly.please try updating the emulator” is displayed in “event log”. The prompt means “unexpected system image feature string. The virtual machine may not work properly. Please update the virtual machine.”

 

Figure 4 warning message

For such error messages, you can lower the API level of the virtual machine. For example, if the API level of the current virtual machine is 30 and the above warning information will be displayed, delete the virtual machine and create a virtual machine with API level 29, as shown in Figure 5.

 

Figure 5 virtual machine API level  

 

Plugin Error: Plugin “Android Code Generator“ is incompatible (supported only in IntelliJ IDEA)

1. Question

Plugin Error: Plugin “Android Code Generator” is incompatible (supported only in IntelliJ IDEA).

2. Solution

C:/Users/Admin/AppData/Roaming/Google/AndroidStudio4.2/plugins

After deleting the file, restart the as to solve the problem.

3. Detailed steps

1. Enter the directory of Disk C and click the [user] folder

2. Find the directory of your [administrator] user name, that is, admin above

3. If you enter at this time, you may not find the appdata folder, so you need to open the hidden directory to see it (take win10 as an example here)

4. Follow the above file path to find the directory where the file is located

5. Delete the error folder. This is Android codegenerator plugin IntelliJ

6. Restart Android studio

errorCode:9015,errorMsg:cn.bmob.v3.util.BmobContentProvider.updateProvider(BmobContentProvider.java:

About the 9015 null pointer in the bmob backend cloud service platform, I checked it online. The reason is very simple, that is, it does not operate according to the official documents. Although the data can still be transmitted normally, it is still annoying to open the app with a prompt pop-up window.

Solution:

Directly open androidmanifest.xml and add two lines of code

        <provider
            android:name="cn.bmob.v3.util.BmobContentProvider"
            android:authorities="com.example.login.BmobContentProvider"/>

If I can help you, just give me a favor!!!   Thank you from the majority of hard pressed programmers!