Android Studio自动导包
很多同学在使用Android Studio的时候会发现不进行设置的话它不能自动的导入一些包名,当然有快捷键Alter + enter键但是只能导入一个。但是当我们的项目比较大的时候,有些代码和方法用的比较多的时候,我们手动导包会显得比较麻烦。 1,setting或者选择studio的小小扳手 然后就可以自动导入了。
今天在看MTK提供的SDK编译文档,按照步骤做,结果出错了,文档如下:
2- Building an SDK for MacOS and Linux
--------------------------------------
First, setup your development environment and get the Android source code from
git as explained here:
http://source.android.com/source/download.html
For example for the cupcake branch:
$ mkdir ~/my-android-git
$ cd ~/my-android-git
$ repo init -u https://android.googlesource.com/platform/manifest -b master -g all,-notdefault,tools
$ repo sync
Then once you have all the source, simply build the SDK using:
$ cd ~/my-android-git
$ . build/envsetup.sh
$ lunch sdk-eng 这个sdk-eng指的是对应的mtk版本
$ make sdk
This will take a while, maybe between 20 minutes and several hours depending on
your machine. After a while you'll see this in the output:
Package SDK: out/host/darwin-x86/sdk/android-sdk_eng.<build-id>_mac-x86.zip
Some options:
- Depending on your machine you can tell 'make' to build more things in
parallel, e.g. if you have a dual core, use "make -j4 sdk" to build faster.
- You can define "BUILD_NUMBER" to control the build identifier that gets
incorporated in the resulting archive. The default is to use your username.
One suggestion is to include the date, e.g.:
$ export BUILD_NUMBER=${USER}-`date +%Y%m%d-%H%M%S`
There are certain characters you should avoid in the build number, typically
everything that might confuse 'make' or your shell. So for example avoid
punctuation and characters like $ & : / \ < > , and .我直接按照上面的命令敲,结果发现出错,后来才知道,这里是sdk指的是对应的某某工程的名字,我这个工程名为
em_t8370_emmc,所以我的sdk名字就是em_t8370_emmc,看来文档有时会让人产生误解的啊,还好是老一辈的总工告诉了我,不然我还蒙在谷里呢!!今天总算知道了,呵呵呵。
然后,说说我遇到的问题和如何解决的方法吧:
1、按照源码中sdk目录下的howto_build_SDK.txt参考文档的编译方式 $ cd ~/my-android-git $ . build/envsetup.sh $ lunch sdk-eng $ make sdk 结果,产生错误log信息如下: device/mediatek/build/build/libs/custom.mk:159: PWD = /mnt/sdb1/yangyx/MT8127_M0_MP8_0407 device/mediatek/build/build/libs/custom.mk:160: *** Can not find ProjectConfig.mk , MTK_PROJECT_CONFIGS = . Stop. #### make failed to build some targets (48 seconds) #### 2、根据一些参考资料,我解决以上相关问题采用以下步骤: source build/envsetup lunch em_t8370_emmc-user source build/envsetup #需要重新source一次,我也不知道为什么,如果不重新再执行这句话,编译还是会产生像上面一样的问题。 make sdk 结果,产生的错误log信息如下: Package SDK: out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476082019_linux-x86.zip SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libexif.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_blkid.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_com_err.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_e2p.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_profile.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_quota.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2_uuid.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libext2fs.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libiprouteutil.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libnetlink.so SDK: warning: including GNU target out/target/product/em_t8370_emmc/system/lib/libnl.so development/build/sdk.atree:49: couldn't locate source file: bin/etc1tool development/build/sdk.atree:88: couldn't locate source file: bin/split-select development/build/sdk.atree:93: couldn't locate source file: bin/bcc_compat development/build/sdk.atree:186: couldn't locate source file: framework/layoutlib.jar development/build/sdk.atree:525: couldn't locate source file: framework/layoutlib-tests.jar development/build/sdk.atree:526: couldn't locate source file: system/app/EmulatorSmokeTests/EmulatorSmokeTests.apk make: *** [out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476082019_linux-x86.zip] Error 44 3、注释以上sdk.atress 49 88 93 186 525 526 相关的脚本 编译成功,在相关目录下生成以下的文件: Package SDK: out/host/darwin-x86/sdk/android-sdk_eng.<build-id>_mac-x86.zip 生成的android.jar是最新的: /out/host/linux-x86/sdk/em_t8370_emmc/android-sdk_1476083189_linux-x86/platforms/android-6.0/android.jar
微信关注我们
转载内容版权归作者及来源网站所有!
低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。
为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。
Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。
Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。