最近公司的产品平台升级,芯片厂商换了,Android版本也由原来的Android 9 升级到了Android 12;
Audio模块要求支持支持多通道录音,于是在源码里新增了几个音频通道常量的定义,包括Audio的java层和hal层,主要新增的文件如下:
frameworks/base/media/java/android/media/AudioFormat.java
public static int inChannelMaskFromOutChannelMask(int outMask) throws IllegalArgumentException {
if (outMask == CHANNEL_OUT_DEFAULT) {
throw new IllegalArgumentException(
"Illegal CHANNEL_OUT_DEFAULT channel mask for input.");
}
switch (channelCountFromOutChannelMask(outMask)) {
case 1:
return CHANNEL_IN_MONO;
case 2:
return CHANNEL_IN_STEREO;
/**add by *** mic start**/
case 8:
return CHANNEL_IN_08;
case 12:
return CHANNEL_IN_12;
case 16:
return CHANNEL_IN_16;
/**add by *** mic end**/
default:
throw new IllegalArgumentException("Unsupported channel configuration for input.");
}
}
system/media/alsa_utils/alsa_device_profile.c
system/media/audio/include/system/audio-hal-enums.h
hardware/libhardware/modules/usbaudio/audio_hal.c
API增加完之后编译报错 1:
[ 83% 111200/133076] //system/media/audio_utils:libaudioutils header-abi-diff libaudioutils.so.abidiff
FAILED: out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.abidiff
(prebuilts/clang-tools/linux-x86/bin/header-abi-diff -allow-unreferenced-changes -allow-unreferenced-elf-symbol-changes -lib libaudioutils -arch arm64 -o out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.abidiff -new out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.lsdump -old prebuilts/abi-dumps/vndk/31/64/arm64_armv8-a/source-based/libaudioutils.so.lsdump)|| (echo 'error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libaudioutils' && (mkdir -p $DIST_DIR/abidiffs && cp out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.abidiff $DIST_DIR/abidiffs/) && exit 1)
******************************************************
error: VNDK library: libaudioutils's ABI has INCOMPATIBLE CHANGES Please check compatibility report at: out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.abidiff
******************************************************
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libaudioutils
[ 83% 111203/133076] //system/media/audio_utils:libaudioutils header-abi-diff libaudioutils.so.abidiff [arm]
FAILED: out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm_armv8-a_shared/libaudioutils.so.abidiff
(prebuilts/clang-tools/linux-x86/bin/header-abi-diff -allow-unreferenced-changes -allow-unreferenced-elf-symbol-changes -lib libaudioutils -arch arm -o out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm_armv8-a_shared/libaudioutils.so.abidiff -new out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm_armv8-a_shared/libaudioutils.so.lsdump -old prebuilts/abi-dumps/vndk/31/64/arm_armv8-a/source-based/libaudioutils.so.lsdump)|| (echo 'error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libaudioutils' && (mkdir -p $DIST_DIR/abidiffs && cp out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm_armv8-a_shared/libaudioutils.so.abidiff $DIST_DIR/abidiffs/) && exit 1)
******************************************************
error: VNDK library: libaudioutils's ABI has INCOMPATIBLE CHANGES Please check compatibility report at: out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm_armv8-a_shared/libaudioutils.so.abidiff
******************************************************
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libaudioutils
[ 83% 111304/133076] soong_build docs out/soong/docs/soong_build.html
libRkTeeWeaver want to conditional Compile
libgralloc_priv want to conditional Compile
初看这里的报错,一脸懵逼--,再仔细深入读英文得知在out目录有一份报告,
地址是 out/soong/.intermediates/system/media/audio_utils/libaudioutils/android_vendor.31_arm64_armv8-a_shared/libaudioutils.so.abidiff
进入out目录后,打开文档内容:
lib_name: "libaudioutils"
2 arch: "arm"
3 enum_type_diffs {
4 type_stack: "android::audio_utils::Balance::setBalance-> android::audio_utils::Balance *-> android::audio_utils::Balance-> audio_channel_mask_t-> "
5 name: "audio_channel_mask_t"
6 fields_diff {
7 old_field {
8 enum_field_value: 7864316
9 name: "AUDIO_CHANNEL_IN_ALL"
10 }
11 new_field {
12 enum_field_value: 7864318
13 name: "AUDIO_CHANNEL_IN_ALL"
14 }
15 }
16 fields_added {
17 enum_field_value: 262152
18 name: "AUDIO_CHANNEL_IN_08"
19 }
20 fields_added {
21 enum_field_value: 262162
22 name: "AUDIO_CHANNEL_IN_12"
23 }
24 fields_added {
25 enum_field_value: 262176
26 name: "AUDIO_CHANNEL_IN_16"
27 }
28 }
29 compatibility_status: INCOMPATIBLE
AUDIO_CHANNEL_IN_ALL的值确实不一样,再就是后面我新增的三个音频通道的定义,看到这里其实也没有什么解决思路。。。
后来再仔细阅读报错信息,其实这里有说明如何解决:
error: Please update ABI references with: $ANDROID_BUILD_TOP/development/vndk/tools/header-checker/utils/create_reference_dumps.py -l libaudioutils
就是执行一个python脚本,于是回到源码的主目录执行脚本,接着又继续报错

看着是脚本要在out目录创建文件夹,但是我没有权限,后续跟公司SCM沟通,取得root权限后继续执行python脚本,仍然报错!

这有又是什么鬼....问题困扰了我大概1天时间,各种尝试,后来也是网上搜到前辈们的文章,说是还要在执行脚本的后面增加 product参数,也即是-product product_name ,增加该参数后继续执行脚本,以为会编译成功呢,一直没关注终端,半个多小时后,又继续编译报错。。。
错误二:
[ 49% 5177/10550] //packages/modules/Permission/PermissionController:PermissionController aapt2 link [common apex30]
packages/modules/Permission/PermissionController/res/layout-television/preference_permissions_category.xml:35: warn: generated id 'android:id/summary' for external package 'android'.
packages/modules/Permission/PermissionController/res/layout-television/preference_permissions_category.xml:27: warn: generated id 'android:id/title' for external package 'android'.
[ 50% 5361/10550] //frameworks/base/packages/SystemUI:SystemUI-core aapt2 link [common]
warn: removing resource com.android.systemui:string/car_add_user without required default value.
warn: removing resource com.android.systemui:string/car_guest without required default value.
warn: removing resource com.android.systemui:string/car_new_user without required default value.
warn: removing resource com.android.systemui:string/start_guest_session without required default value.
warn: removing resource com.android.systemui:string/user_add_user_message_setup without required default value.
warn: removing resource com.android.systemui:string/user_add_user_message_update without required default value.
[ 56% 5907/10471] //packages/apps/TV:LiveTv aapt2 link [common]
warn: removing resource com.android.tv:string/setup_sources_description without required default value.
[ 60% 6146/10211] //frameworks/base:api-stubs-docs-non-updatable check current API [common]
FAILED: out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/check_current_api.timestamp
( true && diff -u -F '{ *$' frameworks/base/core/api/current.txt out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_api.txt && diff -u -F '{ *$' frameworks/base/core/api/removed.txt out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_removed.txt && touch out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/check_current_api.timestamp ) || ( echo -e "\n******************************\nYou have tried to change the API from what has been previously approved.\n\nTo make these errors go away, you have two choices:\n 1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)\n to the new methods, etc. shown in the above diff.\n\n 2. You can update current.txt and/or removed.txt by executing the following command:\n m api-stubs-docs-non-updatable-update-current-api\n\n To submit the revised current.txt to the main Android repository,\n you will need approval.\n******************************\n" ; exit 38 ) # hash of input list: 029245c8d5b1fb42417b35080e5be16671c76fca0c74c985b4a579247f7b7b1e
--- frameworks/base/core/api/current.txt 2022-05-27 12:41:29.773770347 +0800
+++ out/soong/.intermediates/frameworks/base/api-stubs-docs-non-updatable/android_common/metalava/api-stubs-docs-non-updatable_api.txt 2022-05-27 12:49:10.344732414 +0800
@@ -20436,9 +20436,9 @@ public final class AudioFormat implement
field @Deprecated public static final int CHANNEL_CONFIGURATION_MONO = 2; // 0x2
field @Deprecated public static final int CHANNEL_CONFIGURATION_STEREO = 3; // 0x3
field public static final int CHANNEL_INVALID = 0; // 0x0
- field public static final int CHANNEL_IN_08 = 262152; // 0x40008 add by pzxu for DTEN ON mic start
+ field public static final int CHANNEL_IN_08 = 262152; // 0x40008
field public static final int CHANNEL_IN_12 = 262162; // 0x40012
- field public static final int CHANNEL_IN_16 = 262176; // 0x40020 add by pzxu for DTEN ON mic end
+ field public static final int CHANNEL_IN_16 = 262176; // 0x40020
field public static final int CHANNEL_IN_BACK = 32; // 0x20
field public static final int CHANNEL_IN_BACK_PROCESSED = 512; // 0x200
field public static final int CHANNEL_IN_DEFAULT = 1; // 0x1
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1. You can add '@hide' javadoc comments (and remove @SystemApi/@TestApi/etc)
to the new methods, etc. shown in the above diff.
2. You can update current.txt and/or removed.txt by executing the following command:
m api-stubs-docs-non-updatable-update-current-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
12:50:19 ninja failed with: exit status 1
#### failed to build some targets (08:48 (mm:ss)) ####
这种编译错误,其实有些似曾相识,在Android 低版本时 新增API后也遇到过类似的错误,主要是在android 的framework层增加了API后,要更新 frameworks/base/core/api/current.txt 的文档,是通过 make update-api 命令执行的更新,命令执行后文档里会生成一句新增接口的标识常量
但是仔细看这里提示的是 m api-stubs-docs-non-updatable-update-current-api
不同版本略微有不同,不过实际还是一样的,经过尝试,有效的执行命令是:
make api-stubs-docs-non-updatable-update-current-api
另外还补充一句,执行该脚本时也需要out目录的root权限,由于公司编译架构的限制,开始执行该脚本时,也会报权限不允许,后来是跟SCM沟通开放root权限后,才得以执行成功,至此整个软件版本也编译通过
参考:
(6条消息) You have tried to change the API from what has been previously approved_平仄散人的博客-CSDN博客
(6条消息) Android P VNDK报错_他叫小黑的博客-CSDN博客_create_reference_dumps.py
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
尝试通过RVM将RubyGems升级到版本1.8.10并出现此错误:$rvmrubygemslatestRemovingoldRubygemsfiles...Installingrubygems-1.8.10forruby-1.9.2-p180...ERROR:Errorrunning'GEM_PATH="/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/ruby-1.9.2-p180@global:/Users/foo/.rvm/gems/ruby-1.9.2-p180:/Users/foo/.rvm/gems/rub
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
我有用于控制用户任务的Rails5API项目,我有以下错误,但并非总是针对相同的Controller和路由。ActionController::RoutingError:uninitializedconstantApi::V1::ApiController我向您描述了一些我的项目,以更详细地解释错误。应用结构路线scopemodule:'api'donamespace:v1do#=>Loginroutesscopemodule:'login'domatch'login',to:'sessions#login',as:'login',via::postend#=>Teamroutessc
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
我正在尝试使用boilerpipe来自JRuby。我看过guide从JRuby调用Java,并成功地将它与另一个Java包一起使用,但无法弄清楚为什么同样的东西不能用于boilerpipe。我正在尝试基本上从JRuby中执行与此Java等效的操作:URLurl=newURL("http://www.example.com/some-location/index.html");Stringtext=ArticleExtractor.INSTANCE.getText(url);在JRuby中试过这个:require'java'url=java.net.URL.new("http://www
我意识到这可能是一个非常基本的问题,但我现在已经花了几天时间回过头来解决这个问题,但出于某种原因,Google就是没有帮助我。(我认为部分问题在于我是一个初学者,我不知道该问什么......)我也看过O'Reilly的RubyCookbook和RailsAPI,但我仍然停留在这个问题上.我找到了一些关于多态关系的信息,但它似乎不是我需要的(尽管如果我错了请告诉我)。我正在尝试调整MichaelHartl'stutorial创建一个包含用户、文章和评论的博客应用程序(不使用脚手架)。我希望评论既属于用户又属于文章。我的主要问题是:我不知道如何将当前文章的ID放入评论Controller。
我不知道为什么,但是当我设置这个设置时它无法编译设置:static_cache_control,[:public,:max_age=>300]这是我得到的syntaxerror,unexpectedtASSOC,expecting']'(SyntaxError)set:static_cache_control,[:public,:max_age=>300]^我只想将“过期”header设置为css、javaascript和图像文件。谢谢。 最佳答案 我猜您使用的是Ruby1.8.7。Sinatra文档中显示的语法似乎是在Ruby1.
首先回顾一下拉格朗日定理的内容:函数f(x)是在闭区间[a,b]上连续、开区间(a,b)上可导的函数,那么至少存在一个,使得:通过这个表达式我们可以知道,f(x)是函数的主体,a和b可以看作是主体函数f(x)中所取的两个值。那么可以有, 也就意味着我们可以用来替换 这种替换可以用在求某些多项式差的极限中。方法: 外层函数f(x)是一致的,并且h(x)和g(x)是等价无穷小。此时,利用拉格朗日定理,将原式替换为 ,再进行求解,往往会省去复合函数求极限的很多麻烦。使用要注意:1.要先找到主体函数f(x),即外层函数必须相同。2.f(x)找到后,复合部分是等价无穷小。3.要满足作差的形式。如果是加