Facing error while using image_picker in flutter - android-studio

Hy, I am new to flutter and while working with an app that uses image_picker to get images from the gallery I was facing this error.
C:\Users\Hrishabh Mishra\Desktop\FDR\Flutter\course\08\mycameraapp>flutter run
Launching lib\main.dart on Redmi Note 5 Pro in debug mode...
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:15: error: package android.support.annotation does not exist
import android.support.annotation.VisibleForTesting;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:16: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:17: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerFileProvider.java:3: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerFileProvider.java:10: error: cannot find symbol
public class ImagePickerFileProvider extends FileProvider {}
^
symbol: class FileProvider
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerPlugin.java:8: error: package android.support.annotation does not exist
import android.support.annotation.VisibleForTesting;
^
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:68: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_CHOOSE_IMAGE_FROM_GALLERY = 2342;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:69: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_TAKE_IMAGE_WITH_CAMERA = 2343;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:70: error: cannot find symbol
#VisibleForTesting static final int REQUEST_EXTERNAL_IMAGE_STORAGE_PERMISSION = 2344;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:71: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CAMERA_IMAGE_PERMISSION = 2345;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:72: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_CHOOSE_VIDEO_FROM_GALLERY = 2352;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:73: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CODE_TAKE_VIDEO_WITH_CAMERA = 2353;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:74: error: cannot find symbol
#VisibleForTesting static final int REQUEST_EXTERNAL_VIDEO_STORAGE_PERMISSION = 2354;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:75: error: cannot find symbol
#VisibleForTesting static final int REQUEST_CAMERA_VIDEO_PERMISSION = 2355;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:77: error: cannot find symbol
#VisibleForTesting final String fileProviderName;
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:164: error: cannot find symbol
#VisibleForTesting
^
symbol: class VisibleForTesting
location: class ImagePickerDelegate
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerPlugin.java:40: error: cannot find symbol
#VisibleForTesting
^
symbol: class VisibleForTesting
location: class ImagePickerPlugin
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:122: error: cannot find symbol
return ActivityCompat.checkSelfPermission(activity, permissionName)
^
symbol: variable ActivityCompat
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:128: error: cannot find symbol
ActivityCompat.requestPermissions(activity, new String[] {permissionName}, requestCode);
^
symbol: variable ActivityCompat
H:\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.4.12+1\android\src\main\java\io\flutter\plugins\imagepicker\ImagePickerDelegate.java:140: error: cannot find symbol
return FileProvider.getUriForFile(activity, fileProviderName, file);
^
symbol: variable FileProvider
20 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':image_picker:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
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
BUILD FAILED in 28s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 32.5s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin image_picker...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 22.3s
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
The current default is 'false'
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'imagepicker'.
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
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
BUILD FAILED in 16s
The plugin image_picker could not be built due to the issue above.

SDK location not found. Define location with sdk.dir in the local.properties file or
with an ANDROID_HOME environment variable.
Configure the Android SDK first.
Method 1:
Go to Settings
Expand Language & Frameworks
Select Flutter
Enter the flutter sdk path in Flutter SDK Path textbox
Click Ok
Method 2:
Flutter provides a command to update the Android SDK path:
Use flutter config --android-sdk <path-to-your-android-sdk-path>

Related

Importing class from the root folder from a class in a package: unable to resolve class

I have the following directory/package structure in my groovy project:
src
+ progressManagers (package)
| |
| + LoadSensitiveProgressManager.groovy
+ TemporaryRegistry.groovy
Contents of TemporaryRegistry.groovy
// here is no package definition set
public class TemporaryRegistry {}
Contents of LoadSensitiveProgressManager.groovy
package progressManagers
// this gets marked red in my IDE (Intellij Idea)
import TemporaryRegistry
class LoadSensitiveProgressManager implements GenericProgressManager {
}
When i run my code in Scriptrunner for Jira Server the class is not found:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/data/atlassian/application-data/jira/scripts/progressManagers/LoadSensitiveProgressManager.groovy: 7: unable to resolve class TemporaryRegistry
# line 7, column 1.
import TemporaryRegistry
^
1 error
Why is that?
I can "import TemporaryRegistry" from every groovy file in the src folder.
Thanks in advance
Jens

problem with adding Google Analytics to flutter app

I want to add Google Analytic to my flutter app.
this a walk trough that I fallow (Add Analytics to Your Android App
)
when I do the steps of the linked help, I got error in build process,
and my IDE doesn't resolve these imports:
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
I put here my project files:
MainActivity.java:
package com.example.flutterapp;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
public class MainActivity extends FlutterActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
}
// Obtain the shared Tracker instance.
AnalyticsApplication application = (AnalyticsApplication)
getApplication();
private static Tracker mTracker = application.getDefaultTracker();
mTracker.setScreenName("home");
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
}
AnalyticsApplication.java:
package com.example.flutterapp;
import android.app.Application;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;
public class AnalyticsApplication extends Application {
private static GoogleAnalytics sAnalytics;
private static Tracker sTracker;
#Override
public void onCreate() {
super.onCreate();
sAnalytics = GoogleAnalytics.getInstance(this);
}
/**
* Gets the default {#link Tracker} for this {#link Application}.
* #return tracker
*/
synchronized public Tracker getDefaultTracker() {
// To enable debug logging use: adb shell setprop log.tag.GAv4 DEBUG
if (sTracker == null) {
sTracker = sAnalytics.newTracker(R.xml.global_tracker);
}
return sTracker;
}
}
the error I get when I build:
...............................
Launching lib\main.dart on SM J320F in debug mode...
Initializing gradle...
[{"event":"app.progress","params":{"appId":"11b94d0e-10f8-4ea3-aa07-9c1df09f1d27","id":"1","progressId":null,"message":"Resolving dependencies..."}}]Resolving dependencies...
Gradle task 'assembleDebug'...
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:22: error: <identifier> expected
mTracker.setScreenName("home");
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:22: error: illegal start of type
mTracker.setScreenName("home");
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: <identifier> expected
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: illegal start of type
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: ')' expected
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: ';' expected
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: invalid method declaration; return type required
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
D:\projects\flutter_test\flutter_app\android\app\src\main\java\com\example\flutterapp\MainActivity.java:23: error: ';' expected
mTracker.send(new HitBuilders.ScreenViewBuilder().build());
^
8 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
BUILD FAILED in 22s
Finished with error: Gradle task assembleDebug failed with exit code 1
...............................
how Can I solve this problem?
please help me, thank you.
I think it's because of AndroidX compatibility. You can try to change to older version of dependency. That helped me for some dependencies.

pip install matplotlib gives error

I use Mac OSX Sierra, and am trying to install matplotlib in python 3.7, and therefore use
pip3.7 install matplotlib
But that gives me an error
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/include -I/usr/X11/include -I/opt/X11/include -I/opt/local/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_macosx.m -o build/temp.macosx-10.11-x86_64-3.7/src/_macosx.o
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' after #class
#class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: error: cannot find protocol declaration for 'ObjectType'
#class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: error: cannot find protocol declaration for 'ObjectType'
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected identifier or '('
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:13: error: expected ')'
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:3: note: to match this '('
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:25: error: cannot find protocol declaration for 'ObjectType'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:1: error: duplicate interface definition for class 'NSEnumerator'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:12: note: previous definition is here
#interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:37: error: method type specifier must start with '-' or '+'
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:38: error: expected a type
#interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected selector for Objective-C method
#property (readonly, copy) NSArray<ObjectType> *allObjects;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:36: error: cannot find protocol declaration for 'ObjectType'
#property (readonly, copy) NSArray<ObjectType> *allObjects;
^
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:32: error: cannot find protocol declaration for 'ObjectType'
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected identifier or '('
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: expected a type
- (ObjectType)objectAtIndex:(NSUInteger)index;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')'
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:33: note: to match this '('
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:20: error: cannot find protocol declaration for 'ObjectType'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:1: error: duplicate interface definition for class 'NSArray'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:12: note: previous definition is here
#interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:32: error: method type specifier must start with '-' or '+'
#interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:33: error: expected a type
#interface NSArray<ObjectType> (NSExtendedArray)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for matplotlib
Any suggestions on how to fix this would be really appreciated.

node-gyp rebuild error while installing node_xslt on Mac

I have tried to install node_xslt but couldn't fix the issue, here is all I have done : updating homebrew, node.js, npm, deleting .node-gyp, ...
Please help me...
Thank you in advance.
npm install node_xslt
> node_xslt#0.1.9 preinstall /Users/David/node_modules/.staging/node_xslt-4c6485e9
> node-gyp rebuild
CXX(target) Release/obj.target/node_xslt/node_xslt.o
../node_xslt.cc:18:17: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope handlescope;
^
/Users/David/.node-gyp/6.9.2/include/node/v8.h:915:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../node_xslt.cc:19:30: error: member reference type 'Persistent<v8::Value>' is not a pointer; did you mean to use '.'?
Local<Object> obj = value->ToObject();
~~~~~^~
.
../node_xslt.cc:19:32: error: no member named 'ToObject' in 'v8::Persistent<v8::Value, v8::NonCopyablePersistentTraits<v8::Value> >'
Local<Object> obj = value->ToObject();
~~~~~ ^
../node_xslt.cc:26:17: error: calling a protected constructor of class 'v8::HandleScope'
HandleScope handlescope;
^
/Users/David/.node-gyp/6.9.2/include/node/v8.h:915:13: note: declared protected here

Getting SparkFlumeProtocol and EventBatch not found errors when building Spark 1.6.2 on CentOS7

I was trying to build Spark 1.6.2 on CentOS7 and ran into the error below:
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkAvroCallbackHandler.scala:45: not found: type SparkFlumeProtocol
[error] val transactionTimeout: Int, val backOffInterval: Int) extends SparkFlumeProtocol with Logging {
[error] ^
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkAvroCallbackHandler.scala:70: not found: type EventBatch
[error] override def getEventBatch(n: Int): EventBatch = {
[error] ^
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/TransactionProcessor.scala:80: not found: type EventBatch
[error] def getEventBatch: EventBatch = {
[error] ^
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkSinkUtils.scala:25: not found: type EventBatch
[error] def isErrorBatch(batch: EventBatch): Boolean = {
[error] ^
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkAvroCallbackHandler.scala:85: not found: type EventBatch
[error] new EventBatch("Spark sink has been stopped!", "", java.util.Collections.emptyList())
[error] ^
[warn] Class org.jboss.netty.channel.ChannelFactory not found - continuing with a stub.
[warn] Class org.jboss.netty.channel.ChannelFactory not found - continuing with a stub.
[warn] Class org.jboss.netty.channel.ChannelPipelineFactory not found - continuing with a stub.
[warn] Class org.jboss.netty.handler.execution.ExecutionHandler not found - continuing with a stub.
[warn] Class org.jboss.netty.channel.ChannelFactory not found - continuing with a stub.
[warn] Class org.jboss.netty.handler.execution.ExecutionHandler not found - continuing with a stub.
[warn] Class org.jboss.netty.channel.group.ChannelGroup not found - continuing with a stub.
[error] /home/pateln16/spark-1.6.2/external/flume-sink/src/main/scala/org/apache/spark/streaming/flume/sink/SparkSink.scala:86: not found: type SparkFlumeProtocol
[error] val responder = new SpecificResponder(classOf[SparkFlumeProtocol], handler.get)
I meet the same problem on Spark 2.0.0. I think the reason is that file 'external\flume-sink\src\main\avro\sparkflume.avdl' is not complied well.
The problem can be resolved by:
Download Apache Avro
http://avro.apache.org/docs/current/gettingstartedjava.html
I downloaded all jar files into folder 'C:\Downloads\avro'.
Go to folder 'external\flume-sink\src\main\avro'
compile sparkflume.avdl to java files
java -jar C:\Downloads\avro\avro-tools-1.8.1.jar idl sparkflume.avdl > sparkflume.avpr
java -jar C:\Downloads\avro\avro-tools-1.8.1.jar compile -string protocol sparkflume.avpr ..\scala
recompile your projects.

Resources