Skip to content
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
23 changes: 11 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
group 'com.tfliteflutter.tflite_flutter_plugin'
version '1.0'
// Top-level build file for tflite_flutter plugin

buildscript {
repositories {
google()
jcenter()
mavenCentral() // Ganti jcenter() dengan mavenCentral()
}

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

rootProject.allprojects {
repositories {
google()
jcenter()
classpath 'com.android.tools.build:gradle:8.0.2' // Versi AGP terbaru
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 28
namespace 'com.tfliteflutter.tflite_flutter_plugin' // Tambahkan namespace
compileSdkVersion 33 // Versi SDK terbaru

defaultConfig {
minSdkVersion 16
targetSdkVersion 33 // Target SDK terbaru
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
implementation 'org.tensorflow:tensorflow-lite:2.12.0' // Dependensi TensorFlow Lite terbaru
}
3 changes: 1 addition & 2 deletions lib/src/tensor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class Tensor {
/// Underlying data buffer as bytes.
Uint8List get data {
final data = cast<Uint8>(tfLiteTensorData(_tensor));
return UnmodifiableUint8ListView(
data.asTypedList(tfLiteTensorByteSize(_tensor)));
return Uint8List.fromList(data);
}

/// Quantization Params associated with the model, [only Android]
Expand Down