[android] improve missing controller error and align AGP/Gradle

This commit is contained in:
Mario Zechner 2026-02-27 19:17:03 +01:00
parent e2cea180b7
commit 863f08503b
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
[versions]
agp = "8.3.1"
agp = "8.11.2"
kotlin = "1.9.0"
coreKtx = "1.10.1"
junit = "4.13.2"

View File

@ -1,6 +1,6 @@
#Thu Apr 25 11:12:13 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -351,10 +351,18 @@ public class SpineView extends View implements Choreographer.FrameCallback {
}
private void loadFrom (AndroidSkeletonDrawableLoader loader) {
if (controller == null) {
throw new IllegalStateException(
"SpineController is not set. When using SpineView from XML, call setController(...) before loadFromAsset/loadFromFile/loadFromHttp/loadFromDrawable.");
}
Handler mainHandler = new Handler(Looper.getMainLooper());
Thread backgroundThread = new Thread( () -> {
final AndroidSkeletonDrawable skeletonDrawable = loader.load();
mainHandler.post( () -> {
if (controller == null) {
throw new IllegalStateException(
"SpineController became null before initialization. Ensure setController(...) is called and not cleared until loading completes.");
}
computedBounds = boundsProvider.computeBounds(skeletonDrawable);
updateCanvasTransform();