I recently updated my Android Studio version to 2.3. Everything works fine but except the problem that I am facing with AnnotationProcessor support in the build.gradle
.
What I am Intended to do:
I want to use Annotation based Permission Dispatcher library in my project but I couldn't able to successfully build my project since gradle throwing following build errors
Error:(14, 9) error: cannot find symbol variable MainActivityPermissionsDispatcher
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
My Code:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* Couldn't import MainActivityPermissionsDispatcher
import in my code since it is throwing error as stated above */
MainActivityPermissionsDispatcher.showCameraWithCheck(this);
}
}
My build.gradle
:
ext{
permissionDispatcherVersion = '2.3.2'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
compile "com.github.hotchemi:permissionsdispatcher:$permissionDispatcherVersion"
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:$permissionDispatcherVersion"
}
What I tried:
I tried enabling Annotation processors in Android Studio preferences as shown below suggestions found on enable Annotation Processors option in Android Studio 2.2
Any sort of clue or suggestions would be very helpful. I have been stuck with this issue for more than 2 days since I couldn't able to find any workaround. Thanks in advance.