Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@ version '1.0-SNAPSHOT'
buildscript {
repositories {
jcenter()
google()
}

dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

allprojects {
repositories {
jcenter()
google()
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion '25.0.3'

compileSdkVersion 27
defaultConfig {
minSdkVersion 16
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
lintOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;

import android.content.Context;
import android.os.Build;
Expand All @@ -24,7 +25,6 @@ public class AudioplayerPlugin implements MethodCallHandler {
private static final String ID = "bz.rxla.flutter/audio";

private final MethodChannel channel;
private final Registrar registrar;
private final AudioManager am;
private final Handler handler = new Handler();
private MediaPlayer mediaPlayer;
Expand All @@ -35,7 +35,6 @@ public static void registerWith(Registrar registrar) {
}

private AudioplayerPlugin(Registrar registrar, MethodChannel channel) {
this.registrar = registrar;
this.channel = channel;
channel.setMethodCallHandler(this);
Context context = registrar.context().getApplicationContext();
Expand Down Expand Up @@ -136,7 +135,7 @@ public void onCompletion(MediaPlayer mp) {
mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener(){
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
channel.invokeMethod("audio.onError", String.format("{\"what\":%d,\"extra\":%d}", what, extra));
channel.invokeMethod("audio.onError", String.format(Locale.US,"{\"what\":%d,\"extra\":%d}", what, extra));
return true;
}
});
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.4'
}
}

Expand Down