'How to load ZeroOneZeroR Auido Mixer Dependency in Android project

I'm very new to Androind and Java programming and have a basic issue with loading dependencies.

I want to use ZeroOneZero android_audio_mixer library. I add lines to my gradle files according to the guidlines in the README.

./build.gradle

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

./app/build.gradle

dependencies {
            ...
            implementation 'com.github.ZeroOneZeroR:android_audio_mixer:v1.1'
    }

There's one difference - in a modern Android studio project there's no allprojects section while in README it was told to put maven { url 'https://jitpack.io' } there (here's the link).

So, having all this I want to use the library code in my activity:

import zeroonezero.android.audio_mixer.AudioMixer;
import zeroonezero.android.audio_mixer.input.AudioInput;
import zeroonezero.android.audio_mixer.input.BlankAudioInput;
import zeroonezero.android.audio_mixer.input.GeneralAudioInput;

import java.io.File;

public class MergeFiles extends AppCompatActivity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_merge_files);
        
        ...

        AudioInput input1 = new GeneralAudioInput(uri);
    }
}


And I get errors - zeroonezero package is unknown (yes I rebuilt gradle). Hence, AudioInput type is unknown.

What I do wrong and how can I load this dependency? How should I setup gradle files?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source