Jump to content

Android Studio - Gradle upgrade breaking spectrums loading


Recommended Posts

@maxmp, I was not able to post in Developers area hence this post here. Basically a request for help/assistance

After my latest upgrade of $YAPS$ skin (v138) recently some users made me aware that the spectrums no longer loaded and defaulted to Poweramp - spectrum-centered. 

To make a long story short, it turns out that the Gradle update from

classpath 'com.android.tools.build:gradle:4.1.3'
to
 classpath 'com.android.tools.build:gradle:4.2.0'

causes the problem. 

below some stacktrace


05-14 10:24:50.796 3579-3579/? W/SkinnableThemeManager: Loading skin=/data/app/skins.v3.Poweramp.apowerampskin-1/base.apk
05-14 10:24:52.212 3579-3579/? E/SkinInfo: fillFromXml bad tag=resources at Binary XML file line #2 app=skins.v3.Poweramp.apowerampskin
05-14 10:24:52.227 3579-3579/? E/SkinInfo: fillFromXml bad tag=resources at Binary XML file line #2 app=skins.v3.Poweramp.apowerampskin
05-14 10:24:52.246 3579-3579/? E/SkinInfo: fillFromXml bad tag=resources at Binary XML file line #2 app=skins.v3.Poweramp.apowerampskin

05-14 10:24:55.037 3579-23702/? E/Loader.cpp: loadPreset bad uri= apk://skins.v3.Poweramp.apowerampskin#cyberia.milk  parse res=1 scheme size=0 uri frag size=0 fragmentOpt size=0
05-14 10:24:55.037 3579-23702/? E/MilkRenderer: preset=null, failed to load= apk://skins.v3.Poweramp.apowerampskin#cyberia.milk  frag=null trying=Poweramp - spectrum-centered
 

it is worth noting that the error:

05-14 10:24:52.246 3579-3579/? E/SkinInfo: fillFromXml bad tag=resources at Binary XML file line #2 app=skins.v3.Poweramp.apowerampskin

shows even when things work as expected.

Reverting back to 'com.android.tools.build:gradle:4.1.3' resolves the issue

 

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 months later...

@maxmp upgrading gradle still fails the loading of spectrums. is this something you can fix ?

image.png.cfcf1cad1ccae342f703c7688b8b9b38.png

 

image.png.e92dfcceb3aca9450688d643e931f281.png

 

2021-08-09 14:40:47.198 3413-3450/com.maxmpz.audioplayer E/Loader.cpp: loadPreset bad uri= apk://skins.v3.Poweramp.apowerampskin#moon.milk parse res=1 scheme size=0 uri frag size=0 fragmentOpt size=0
2021-08-09 14:40:47.198 3413-3450/com.maxmpz.audioplayer E/MilkRenderer: preset=null, failed to load= apk://skins.v3.Poweramp.apowerampskin#moon.milk frag=null trying=Poweramp - spectrum-centered

 

<style name="yaps_spectrum_moon" parent="yaps_mainMiniSpectrum_MilkFRS">
    <item name="com.maxmpz.audioplayer:presetUri">
        apk://skins.v3.Poweramp.apowerampskin#moon.milk</item>
</style>

 

moon.milk

[preset00]
fRating=3.000000
fGammaAdj=2.000000
fDecay=0.980000
fVideoEchoZoom=2.000000
fVideoEchoAlpha=0.000000
nVideoEchoOrientation=0
nWaveMode=0

bAdditiveWaves=0
bWaveDots=0
bModWaveAlphaByVolume=0
bMaximizeWaveColor=1
bTexWrap=0
bDarkenCenter=0
bMotionVectorsOn=0
bRedBlueStereo=0
nMotionVectorsX=12
nMotionVectorsY=9
bBrighten=0
bDarken=0
bSolarize=0
bInvert=0

fWaveAlpha=0.800000

fWaveScale=0.015312
fWaveSmoothing=0.750000

fWaveParam=-0.300000

fModWaveAlphaStart=1.000000
fModWaveAlphaEnd=0.950000

fWarpAnimSpeed=1.000000

fWarpScale=0.500000
fZoomExponent=1.000000
fShader=0.000000

zoom=1.030000
rot=0.000000

cx=0.500000
cy=0.500000

dx=0.000000
dy=0.000000

warp=9.000000

sx=1.000000
sy=1.000000

wave_r=1.000000
wave_g=1.000000
wave_b=0.000000

wave_x=0.500000
wave_y=0.511000

per_frame_1=warp = 0;

per_frame_2=wave_mystery = wave_mystery + .1*sin(time*1.5);
per_frame_3=wave_x = wave_x + (.2+.1*cos(time*1.2))*sin(time*.776);
per_frame_4=wave_y = wave_y + (.2+.1*sin(time))*cos(time*.554);
per_frame_5=wave_r = wave_r + .5*sin(time*.233)+bass*.245;
per_frame_6=wave_g = wave_g + .5*sin(time*.133)+treb*.245;
per_frame_7=wave_b = wave_b + .5*sin(time*.333)+mid*.245;
per_frame_8=dx = dx + (.01+.01*cos(time*1.2))*sin(time*.776);
per_frame_9=dy = dy + (.01+.01*sin(time*1.2))*cos(time*.576);

 

Link to comment
Share on other sites

  • 2 weeks later...

@maxmp, followed instructions in the latest github release, checked out the gradle changes, upgraded to Artic Fox, target 30, 

classpath 'com.android.tools.build:gradle:7.0.1'

Turns out that the spectrums do not work on emulators but appear to work fine on a physical device

 

Link to comment
Share on other sites

@flyingdutchman a bit more data required: what PA version is affected, what are the emulator Android version and architecture, where it doesn't   work, and how exactly milk preset is added to the project (is it skin project? visualization apk?).

Link to comment
Share on other sites

@maxmp I always use the latest release, currently 911.

Emulator:

Emulators Android 10,  built with  Genymotion V3.2.1 and Genymotion-ARM-Translation_for_8.0 applied

Android 11.0 x86 build through  Visual Studio (Artic Fox atm), 

Example of style implementation:

<style name="yaps_mainMiniSpectrum_spectrum_user_defined_1">
    <item name = "spectrum_layout_style">@style/yaps_spectrum_user_defined_1</item>
    <item name="mainMiniSpectrumLayout">@layout/mini_spectrum</item>
    <item name="com.maxmpz.audioplayer:TopWaveseek">@style/TopWaveseek_hide</item>
</style>

<style name="yaps_spectrum_user_defined_1" parent="yaps_mainMiniSpectrum_MilkFRS">
    <item name="com.maxmpz.audioplayer:presetUri">
        apk://skins.v3.Poweramp.apowerampskin#yellow_burst.milk</item>-->
</style>

where parent is

<style name="yaps_mainMiniSpectrum_MilkFRS">
    <item name="android:layout_height">@dimen/yaps_TopWaveseekLayout_Maxheight</item>
    <item name="com.maxmpz.audioplayer:bgColor">@color/transparent</item>
  
    <item name="com.maxmpz.audioplayer:layout_attachTop">
        @com.maxmpz.audioplayer:id/sub_aa_buttons
    </item>
    <item name="com.maxmpz.audioplayer:layout_attachLeft">parent</item>
    <item name="com.maxmpz.audioplayer:layout_attachRight">parent</item>
    <item name="android:layout_gravity">center_vertical</item>
    <item name="com.maxmpz.audioplayer:layout_gravityTarget">@com.maxmpz.audioplayer:id/play
    </item>
</style>

 

Link to comment
Share on other sites

@maxmp although I had thourougly tested this with previous gradle releases and observed consistent behaviour of (working with earlier gradle and error when using later version), the spectrums now suddenly work on the Genymotion emulator but not on the android studio one.

Link to comment
Share on other sites

@flyingdutchman I tested 911 in emulator (x64 Android 11, running Poweramp arm64), and spectrum (bar) visualizations are just not rendered, so I guess this is the root of the issue.

Link to comment
Share on other sites

I would add the next 912 build resolves this issue - spectrum visualizations bug fixed for the emulators, though more issues may arise due to mandatory (by Google) target sdk bump to 30.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...