简体   繁体   中英

Flutter ':path_provider:compileDebugJavaWithJavac' Error

Im having problem in the path provider dependencies in flutter. I've been trying to find a solution for this for almost 2 day now.. please help me..

在此处输入图片说明

My dependencies

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.0
  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+2
  path_provider: ^1.6.5
  http: ^0.12.2

My Code (even without code its running the error as long as a add the path provider)

import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'dart:convert';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:hive/hive.dart';
import 'package:http/http.dart' as http;

void main() async {
  //Hive.initFlutter();
  WidgetsFlutterBinding.ensureInitialized();
  //final appDocDir = await getApplicationDocumentsDirectory();
  // Hive.init(appDocDir.path);

  var box = await Hive.openBox('employee');

  runApp(
    MaterialApp(home: Home()),
  );
}

class Home extends StatefulWidget {
  Home({Key key}) : super(key: key);

  @override
  _HomeState createState() => _HomeState();
}

class _HomeState extends State<Home> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Sample'),
      ),
      body: Center(),
    );
  }
}

我已经通过在终端中执行 flutter pub downgrade 解决了这个问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM