0

I forked this Flutter project and it is supposed to be executing a native Java code which is MusicKit Plugin. But when I run the project I get this error:

Note: C:\Users\angel\Desktop\flutter_music_kit\flutter_musickit\android\src\main\java\com\zivost\musickit\MusickitPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:\Users\angel\.gradle\caches\transforms-1\files-1.1\core-1.6.0.aar\11c6125161db973e0f4388722c28df2b\res\values\values.xml:192:5-228:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  C:\Users\angel\.gradle\caches\transforms-1\files-1.1\core-1.6.0.aar\11c6125161db973e0f4388722c28df2b\res\values\values.xml:192:5-228:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BU�LD FAILED in 39s
Exception: Gradle task assembleDebug failed with exit code 1

The Java code which is mentioned in the error is:

package com.zivost.musickit;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry.Registrar;

/** MusickitPlugin */
public class MusickitPlugin implements MethodCallHandler {
  /** Plugin registration. */
  public static void registerWith(Registrar registrar) {
    final MethodChannel channel = new MethodChannel(registrar.messenger(), "musickit");
    channel.setMethodCallHandler(new MusickitPlugin());
  }

  @Override
  public void onMethodCall(MethodCall call, Result result) {
      result.notImplemented();
  }
}

Something must be deprecated but I don't write Java so I couldn't find. Anyone knows?

D. S. Shatner
  • 40
  • 1
  • 6
  • What is the compileSdkVersion (should be inside :app build.gradle) of the library and your application? – Yash Garg Oct 11 '22 at 20:45
  • compileSdkVersion: 30 – D. S. Shatner Oct 11 '22 at 22:41
  • I think the library you are trying to use has a compileSdkVersion of 27 - https://github.com/zivost/flutter_musickit/blob/5eceddcef3658b816a0355d6e6b98f362cc2b1b4/android/build.gradle#L25. I will suggest forking it and updating it to 28 and then trying again once. – Yash Garg Oct 12 '22 at 08:14

0 Answers0