问题
I upgraded my Android app to start using SDK 29 and build tools 29.0.0. When compiling in Android Studio I get an error:
Process 'command 'C:\Users\ma_fo\AppData\Local\Android\Sdk\build-tools\29.0.0\aidl.exe'' finished with non-zero exit value -1073741819
The actual command executed for aidl is C:\Users\ma_fo\AppData\Local\Android\Sdk\build-tools\29.0.0\aidl.exe with arguments { -pC:\Users\ma_fo\AppData\Local\Android\Sdk\platforms\android-29\framework.aidl -oE:\Work\McDevelopment\android-sales-app-webview\app\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out -IE:\Work\McDevelopment\android-sales-app-webview\app\src\main\aidl -IE:\Work\McDevelopment\android-sales-app-webview\app\src\debug\aidl -IC:\Users\ma_fo.gradle\caches\transforms-2\files-2.1\c21a47fa6bee4a2c237691438c7b1f92\aidl -IC:\Users\ma_fo.gradle\caches\transforms-2\files-2.1\87cbfb92509988fa6d22255a681cc703\aidl -IC:\Users\ma_fo.gradle\caches\transforms-2\files-2.1\4cdb3bb0ddd100ba4f9a12ec5a9fae60\aidl -dC:\Users\ma_fo\AppData\Local\Temp\aidl367254395093906008.d E:\Work\McDevelopment\android-sales-app-webview\app\src\main\aidl\com\android\vending\billing\IInAppBillingService.aidl}
When I run this command manually in an MS-DOS prompt with aidl of build-tools 28.0.3, the compilation passes without any errors.
When I run this command with the aidl of build tools 29.0.0 I get an error: aidl E 06-08 18:07:03 4920 13216 io_delegate.cpp:141] Error while creating E:\Work\McDevelopment\android-sales-app-webview\app\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\E:: Invalid argument
I would expect the manual idl compilation to work for both versions. Is there are problem with the aidl in build tools 29.0.0 ? Or is there something else which I should update ?
回答1:
In my case the *.d file in the -d parameter has a error in the first line.
From build tools 28.0.3:
C:\[PROJECT-PATH]\app\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\com\android\vending\billing\IInAppBillingService.java : \
From build tools 29.0.0
C:\[PROJECT-PATH]\app\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\C:\[PROJECT-PATH]\app\src\main\aidl\com\android\vending\billing\IInAppBillingService.java : \
But I have no solution. I think it is a bug in the build tools 29.0.0.
Update: The build tools version 29.0.1 has solved this problem.
回答2:
It's a known issue which supposedly have been fixed, but it's not: https://issuetracker.google.com/issues/132344897
回答3:
If you got an error after upgrade (like me), then the solution is downgrade. I downgraded from 29.0.0 to 28.0.3 and it works for me:
C:\>"c:\Users\Plinio\AppData\Local\Android\Sdk\tools\bin\sdkmanager" --list --verbose
. . .
Installed packages:=====================] 100% Computing updates...
--------------------------------------
build-tools;29.0.0
Description: Android SDK Build-Tools 29
Version: 29.0.0
Installed Location: c:\Users\Plinio\AppData\Local\Android\Sdk\build-tools\29.0.0
. . .
Available Packages:
--------------------------------------
. . .
build-tools;28.0.1
Description: Android SDK Build-Tools 28.0.1
Version: 28.0.1
build-tools;28.0.2
Description: Android SDK Build-Tools 28.0.2
Version: 28.0.2
build-tools;28.0.3
Description: Android SDK Build-Tools 28.0.3
Version: 28.0.3
build-tools;29.0.0
Description: Android SDK Build-Tools 29
Version: 29.0.0
. . .
C:\>"c:\Users\Plinio\AppData\Local\Android\Sdk\tools\bin\sdkmanager" build-tools;28.0.3
C:\>"c:\Users\Plinio\AppData\Local\Android\Sdk\tools\bin\sdkmanager" --uninstall build-tools;29.0.0
Before to downgrade, I tried to check this issue. If you notice, there is an "E:" at the end of the path. It looks like a bug of aidl.exe if there isn't an output file assigned as second parameters.
aidl.exe [OPTION]... INPUT [OUTPUT]
Check your error message (like the mine):
aidl E 06-08 18:07:03 4920 13216 io_delegate.cpp:141] Error while creating E:\Work\McDevelopment\android-sales-app-webview\app\build\generated\aidl_source_output_dir\debug\compileDebugAidl\out\E:: Invalid argument
来源:https://stackoverflow.com/questions/56510253/android-aidl-error-sdk-build-tools-29-0-0