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

Projects
None yet
2 participants
@chris-sharl

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

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Dec 20, 2016

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?

Owner

iBotPeaches commented Dec 20, 2016

   --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

This comment has been minimized.

Show comment
Hide comment
@chris-sharl

chris-sharl Dec 21, 2016

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>

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

This comment has been minimized.

Show comment
Hide comment
@chris-sharl

chris-sharl Dec 21, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Dec 21, 2016

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.

Owner

iBotPeaches commented Dec 21, 2016

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