< manifest> . . . 
< application> . . . . < / application> 
< queries > < package  android : name= "com.example.clientapplication" / > < intent> < action android: name= "android.intent.action.MService" / > < / intent> 
< / queries> 
< / manifest> 
 
Caused  by:  
java. lang.  RuntimeException:  Didn 't create service "XXX"  on path: 
DexPathList [ [ zip file "/data/app/com.chemao.certification-2/base.apk" ] , 
nativeLibraryDirectories= [ / data/ app/ com. chemao. certification- 2 / lib/ arm,  / vendor/ lib,  / system/ lib] ]                                                      
 
 
 
 
 
public  class  MService  extends  Service  { private  IAidlInterface  mBinder; @Nullable @Override public  IBinder  onBind ( Intent  intent)  { Log . d ( "TAG" ,  "onBind: "  +  intent) ; return  mBinder. asBinder ( ) ; } @Override public  void  onCreate ( )  { super . onCreate ( ) ; Log . d ( "TAG" ,  "onCreate: " ) ; mBinder =  new  Binder ( ) ; } private  class  Binder  extends  IAidlInterface. Stub { private  static  final  String  TAG  =  "mBinder" ; @Override public  void  basicTypes ( )  throws  RemoteException  { Log . d ( TAG ,  "basicTypes: "  +  "我是服务端数据信息" ) ; } } 
} 
 
 
 
public  class  MainActivity  extends  AppCompatActivity  { private  IAidlInterface  mIExtraAidlInterface; private  ServiceConnection  mServiceConn; @Override protected  void  onCreate ( Bundle  savedInstanceState)  { super . onCreate ( savedInstanceState) ; setContentView ( R . layout. activity_main) ; Button  button =  findViewById ( R . id. name) ; mServiceConn =  new  ServiceConnection ( )  { @Override public  void  onServiceConnected ( ComponentName  name,  IBinder  service)  { mIExtraAidlInterface =  IAidlInterface. Stub . asInterface ( service) ; try  { mIExtraAidlInterface. basicTypes ( ) ; }  catch  ( RemoteException  e)  { throw  new  RuntimeException ( e) ; } Log . d ( TAG ,  "onServiceConnected: " ) ; } @Override public  void  onServiceDisconnected ( ComponentName  name)  { Toast . makeText ( MainActivity . this ,  "0000" ,  Toast . LENGTH_SHORT ) . show ( ) ; Log . d ( TAG ,  "onServiceDisconnected: " ) ; } } ; bindService ( ) ; } private  void  bindService ( ) { Intent  intent =  new  Intent ( ) ; intent. setAction ( "android.intent.action.MService" ) ; intent. setPackage ( "com.example.clientapplication" ) ; ResolveInfo  resolveInfo =  getPackageManager ( ) . resolveService ( intent,  0 ) ; Log . d ( TAG ,  "bindService: "  +  resolveInfo) ; bindService ( intent,  mServiceConn,  BIND_AUTO_CREATE ) ; Log . d ( TAG ,  "mServiceConn: "  +  mServiceConn) ; } @Override public  boolean  bindService ( Intent  service,  ServiceConnection  conn,  int  flags)  { Log . d ( TAG ,  "bindService: service "  +  service +  "conn "  +  conn +  "flags  "  +  flags) ; Log . d ( TAG ,  "bindService: "  +  super . bindService ( service, conn, flags) ) ; return  super . bindService ( service,  conn,  flags) ; } @Override protected  void  onDestroy ( )  { super . onDestroy ( ) ; unbindService ( mServiceConn) ; } 
}