简体   繁体   中英

Andriod:How to set lib path for aapt command?

I was trying to compile Android project using command line in Windows. When I use aapt to generate R file, it comes out an error as below:

 D:\SampleProject\MyApplication>aapt package -f -m -J ./gen -S ./app/src/main/res
 -I "D:\ProgramInstall\Android\Android SDK\platforms\android-21\android.jar" -M
./app/src/main/AndroidManifest.xml 

 .\app\src\main\res\values\styles.xml:4: error: Error retrieving parent for item:
 No resource found that matches the given name 'Theme.AppCompat.Light.DarkAction
Bar'.    

I've found that the Theme.Appcompact.Light.DarkActionBar is related to the APPcompat_v7 floder while the floder is under in the libs floder, How can I let the complier know where to find the lib it need?

我知道它太晚了或者您可能已经找到答案但仍然发布:

D:\SampleProject\MyApplication>aapt package **--auto-add-overlay** -f -m -J ./gen -S ./app/src/main/res **-S "path_to_prebuilts\prebuilts\devtools\extras\android\support\v7\appcompat\res\"** -I "D:\ProgramInstall\Android\Android SDK\platforms\android-21\android.jar" -M ./app/src/main/AndroidManifest.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM