[英]Setting up dexguard license file in android studio
我沒有在dexguard.please中找到dexguard-license.txt文件幫助我在android studio中進行gradle設置這里是我的gradle控制台輸出
Executing tasks: [:app:assembleDebug]
.....
Can't find a DexGuard license file.
You should place your license file dexguard-license.txt
1) in a location defined by the Java system property 'dexguard.license',
2) in a location defined by the OS environment variable 'DEXGUARD_LICENSE',
3) in your home directory,
4) in the class path, or
5) in the same directory as the DexGuard jar.
已經有一段時間了,因為有一個更新的答案,所以我想我會更新,因為DexGuard的許可文件設置已經更改。
我剛剛從Android Studio版本從2.2.3更新到2.3,並且還將我的Gradle版本從2.14.1升級到3.3。 升級到Gradle版本3.3后,我收到了OP記錄的相同錯誤:
Can't find a DexGuard license file.
You should place your license file dexguard-license.txt
1) in a location defined by the Java system property 'dexguard.license',
2) in a location defined by the OS environment variable 'DEXGUARD_LICENSE',
3) in your home directory,
4) in the class path, or
5) in the same directory as the DexGuard jar.
我的DexGuard配置使用Gradle版本2.14.1與我的dexguard-license.txt文件在與DexGuard jar相同的目錄中工作得很好(建議#5)。
事實證明,DexGuard的文檔說明如下:
注意 :使用Gradle 3.1+時,當與DexGuard插件jar放在同一目錄中時,將不再找到許可證文件。
(來源:DexGuard 7.3.10文檔 - >快速入門 - >設置許可證文件)
我想將我的許可證文件保存在與DexGuard jar相同的目錄中,因此我實現了#1的建議。 我通過在我的項目的gradle.properties文件中添加以下行來完成此操作:
systemProp.dexguard.license=./app/libs/Dexguard_7_3_10
請注意,我的DexGaurd jar和我的dexguard-license.txt文件位於以下目錄中:{project folder} / app / libs / DexGuard_7_3_10 /
我選擇了這個解決方案,因為我不僅在本地構建,而且還在Jenkins CI上構建。 此解決方案使我無需在構建服務器本身上實現任何更改(即本地環境變量,將文件復制到服務器主目錄或類路徑選項)。 我希望這可以幫助其他人偶然發現這個問題,並發現錯誤信息令人困惑。
您應該將dexguard-license.txt文件和dexguard.jar文件復制到您的主目錄(:/ user / ironman)。
一旦您登錄https://www.guardsquare.com上的帳戶>文件頁面,即可下載許可證文件
看到這個屏幕截圖
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.