Tag Archives: aidl

Duplicate class com.xxx.xxx Find in modules problem solving (Aidl interdependence problem)

1. Usage scenarios:

A (with Aidl) AAR; B (with Aidl) AAR depends on a;

C (APP) relies on a and B AAR libraries

At this time, both a and B have the same Aidl interface class to report the above error!

2. Problem solving

B (Aidl) AAR depends on A. you can remove the Aidl interface class in class B.

Some problems encountered by Android Aidl

Some problems with Android AIDL
(1) Starting Service ** is required after 5.0
An error will be reported if the service is started implicitly (unless Intent. SetPackage (” application package name of the service to be started “) is started implicitly).
Error:(9, 41) No symbol can be found
The reason is that the other class name (Java) file is mixed with aidl’s aidl file in the same directory
Java files have to be placed under the Java file (server package name + Java file).
Error 1
Error: Error converting the bytecode to dex:
Cause: Java. Lang. RuntimeException: Exception parsing classes
Reason package names contain uppercase letters

example:
er.java
p>ge com.example.lqm;
user.java
package com.example.lqm;
public class User implements Parcelable{
private String id;
privte String name;
… .
}
The corresponding aidl file is
user.aidl
package com.example.lqm; // This is user. aidl package
parcelable User;

Problems in learning Aidl

Java. Lang. SecurityException: Not allowed to bind to the service of Intent

Cause: The client failed to bind the Service on the server side. The Service on the server side could not be called by the external application

When a server registers a Service in Manifast file, add android:exported=”true” attribute to set the Service to be invoked by external applications

<service android:name=".IRemoteService"
            android:exported="true"/>

Aidl communication and problems encountered

AIDLDemo realizes the transmission of basic data types, object types, client and server data mutual transmission, and verifies the server to client in a short time to transfer a large amount of data (equivalent to the standard definition real-time video transmission).
Code at https://github.com/jingxiongdi/AIDLDemo to take away is not at all.
Process ‘command ‘C:\Users\ PC-001 \AppData\Local\Android\ SDK \ Build-Tools \26.0.2\aidl.exe “finished with non-zero exit value 1
If you encounter such an error, you can click Run Task to see where the AIDL file is.