Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runnig aapt without --no-version-vector cause some problem with res/drawable/xxx.xml which contain <vector/> #1384

Closed
chris-sharl opened this issue Dec 20, 2016 · 4 comments

Comments

@chris-sharl
Copy link
Contributor

chris-sharl commented Dec 20, 2016

my project upgrade android-support to 25.0.2
when run aapt will cause some problem with res/drawable/xxx.xml which contain "vector".
1.in res/drawable. "vector" lose content of the "path"
2.in res/drawable-v21. it works fine.

it seems like because runnig aapt without --no-version-vectors.

@iBotPeaches
Copy link
Owner

   --no-version-vectors
       Do not automatically generate versioned copies of vector XML resources.

Are you saying that default apktool execution of aapt should use this parameter? So if I create a vector XML resource it would automatically version this across resources if I don't use this parameter?

@chris-sharl
Copy link
Contributor Author

if I don't use this parameter, aapt would automatically generate versioned copies of vector XML resources.
for example.
origin xml:
<?xml version="1.0" encoding="utf-8"?> <vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z" /> </vector>

after apktool works。
in res/drawable:
<?xml version="1.0" encoding="utf-8"?> <vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0" xmlns:android="http://schemas.android.com/apk/res/android"> <path /> </vector>

in res/drawable-v21:
<?xml version="1.0" encoding="utf-8"?> <vector android:height="24.0dip" android:width="24.0dip" android:viewportWidth="24.0" android:viewportHeight="24.0" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z" /> </vector>

@chris-sharl
Copy link
Contributor Author

so, I add a noVersionVectors in ApkOptions.java, and if noVersionVectors == true, I will add paramter --no-version-vectors in function-aaptPackage in AndrolibResources.java

@iBotPeaches
Copy link
Owner

Okay thanks for the information, because Apktool is suppose to match the original APK as much as possible, I agree with this assessment and will add this parameter to the default execution of apktool during build.

@iBotPeaches iBotPeaches added this to the 2.2.2 - Bug Fixes milestone Dec 21, 2016
iBotPeaches added a commit that referenced this issue Dec 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants