Execution failed for task ':compileDebugAidl'.

Execution failed for task ':compileDebugAidl'.
> java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Error while executing '/opt_dev/android-sdk-linux_new/build-tools/23.0.3/aidl' with arguments {-p/opt_dev/android-sdk-linux_new/platforms/android-26/framework.aidl -o/home/dream/workspace/NewUserHomePage/build/generated/source/aidl/debug}

在android studio 中点开Gradle console,终于找到问题所在:

Executing tasks: [:app:generateDebugSources]

Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
aidl.exe E 08-03 23:11:41 632 10360 aidl.cpp:580] refusing to generate code from aidl file defining parcelable

aidl.exe E 08-03 23:11:41 15108 15164 type_namespace.cpp:107] In file F:\WorkSpace\MyAIDLApplicaion\app\src\main\aidl\com\example\bookserver\IBookManager.aidl line 11 return type List<Book>:
aidl.exe E 08-03 23:11:41 15108 15164 type_namespace.cpp:107] unknown type
aidl.exe E 08-03 23:11:41 15108 15164 type_namespace.cpp:129] In file F:\WorkSpace\MyAIDLApplicaion\app\src\main\aidl\com\example\bookserver\IBookManager.aidl line 12 parameter book (argument 1):
aidl.exe E 08-03 23:11:41 15108 15164 type_namespace.cpp:129] unknown type

 

* What went wrong:
Execution failed for task ':app:compileDebugAidl'.
> java.io.IOException: com.android.ide.common.process.ProcessException: Error while executing process C:\Users\Lxt\AppData\Local\Android\Sdk\build-tools\27.0.3\aidl.exe with arguments {-pC:\Users\Lxt\AppData\Local\Android\Sdk\platforms\android-24\framework.aidl -oF:\WorkSpace\MyAIDLApplicaion\app\build\generated\source\aidl\debug -IF:\WorkSpace\MyAIDLApplicaion\app\src\debug\aidl -IF:\WorkSpace\MyAIDLApplicaion\app\src\main\aidl -IC:\Users\Lxt\.gradle\caches\transforms-1\files-1.1\support-v4-24.0.0.aar\ac7d25dd3c0b8080f2fb8522dd6b5b30\aidl -dC:\Users\Lxt\AppData\Local\Temp\aidl8924051422703672316.d F:\WorkSpace\MyAIDLApplicaion\app\src\main\aidl\com\example\bookserver\IBookManager.aidl}

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

 

 

 

 

 

定位问题后就知道,是在AIDL中未引入

import com.example.bookserver.aidl.Book;


运行还有错误,一般为interface包名是否对应,service中实现的接口方法是否对应,public声明接口方法的实现等。
posted @ 2019-08-04 00:03  tingtasia  阅读(2015)  评论(0编辑  收藏  举报