import android.support.v4.app.ActivityCompat; - java

This is the error i am seeing when i add "simple_permissions" package. How can i fix this? I recently upgraded flutter and it used to work very well before the upgrade.
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
symbol: class ActivityCompat
location: package android.support.v4.app
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
^
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:156: error: cannot find symbol
ActivityCompat.requestPermissions(activity, perm, 0);
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:163: error: cannot find symbol
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
symbol: variable ContextCompat
location: class SimplePermissionsPlugin
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:171: error: cannot find symbol
if (ActivityCompat.shouldShowRequestPermissionRationale(registrar.activity(), permission)) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
/root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:175: error: cannot find symbol
if (ActivityCompat.checkSelfPermission(registrar.context(), permission) == PackageManager.PERMISSION_GRANTED) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':simple_permissions: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 3s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
[!] Flutter tried to create the file `android/settings_aar.gradle`, but failed.
To manually update `settings.gradle`, follow these steps:
1. Copy `settings.gradle` as `settings_aar.gradle`
2. Remove the following code from `settings_aar.gradle`:
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Exception: Please create the file and run this command again.
Exited (sigterm)

I suggest you to check the package before using it.
It seems that simple_permissions is outdated and this package hasn't been updated since 2018 and its repository is gone from github, consider using other package like permission_handler.
Cheers.

Related

after adding wallpaper manager package it showing :(

`
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\wallpaper_manager-1.0.10\android\src\main\java\com\mulgundkar\wallpaper_manager\WallpaperManagerPlugin.java:129: error: cannot find symbol
String assetLookupKey = FlutterLoader.getInstance().getLookupKeyForAsset(assetPath);
^
symbol: method getInstance()
location: class FlutterLoader
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\wallpaper_manager-1.0.10\android\src\main\java\com\mulgundkar\wallpaper_manager\WallpaperManagerPlugin.java:152: error: cannot find symbol
String assetLookupKey = FlutterLoader.getInstance().getLookupKeyForAsset(assetPath);
^
symbol: method getInstance()
location: class FlutterLoader
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':wallpaper_manager:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
`
wallpaper_manager: any
When I add the package, the project gives an error.
There was no problem in the old versions of flutter, but the application does not work anymore, how should I proceed?
If you look at the current javadocs for FlutterLoader, it doesn't declare a getInstance() method anymore. The method was deprecated and then removed.
According to https://stackoverflow.com/a/64456438/139985, since Flutter 1.22 you need to get hold of a FlutterLoader instance using FlutterInjector:
import io.flutter.FlutterInjector;
...
FlutterLoader loader = FlutterInjector.instance().flutterLoader();
See also: What does a "Cannot find symbol" or "Cannot resolve symbol" error mean?

Gauge Failed to start gauge API: Error occurred while waiting for runner process to finish

I'm quite new to gauge and have problems running a set of gauge tests. When I try to gauge run I get the following console output:
src\main\java\de\...\qa\Common.java:3: error: package com.github.....gauge.graphql does not exist
import com.github.....gauge.graphql.GraphqlSetup;
^
symbol: class VariableStorage
location: class Pricing
src\main\java\de\...\qa\testcraft\GaugeTestCraft.java:3: error: package com.github.....gauge.random.data does not exist
import com.github.....gauge.random.data.VariableStorage;
^
src\main\java\de\...\qa\testcraft\TestCraftExecutor.java:4: error: package org.tinylog does not exist
import org.tinylog.Logger;
^
src\test\java\de\...\qa\PricingTest.java:8: error: package org.junit.jupiter.api does not exist
import org.junit.jupiter.api.Test;
^
src\test\java\de\...\qa\PricingTest.java:9: error: package org.yaml.snakeyaml does not exist
import org.yaml.snakeyaml.Yaml;
^
src\test\java\de\...\qa\TestVariableStorage.java:3: error: package com.github.....gauge.random.data does not exist
import com.github.....gauge.random.data.VariableStorage;
^
src\test\java\de\...\qa\TestVariableStorage.java:9: error: cannot find symbol
public class TestVariableStorage implements VariableStorage {
^
symbol: class VariableStorage
src\test\java\de\...\qa\PricingTest.java:26: error: cannot find symbol
#Test
^
symbol: class Test
location: class PricingTest
src\test\java\de\...\qa\PricingTest.java:33: error: cannot find symbol
#Test
^
symbol: variable Logger
location: class TestCraftExecutor
src\test\java\de\...\qa\TestVariableStorage.java:12: error: method does not override or implement a method from a supertype
#Override
^
src\test\java\de\...\qa\TestVariableStorage.java:17: error: method does not override or implement a method from a supertype
#Override
^
src\test\java\de\...\qa\TestVariableStorage.java:22: error: method does not override or implement a method from a supertype
#Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
55 errors
Error occurred while waiting for runner process to finish.
Error : exit status 1
Error ----------------------------------
[Gauge]
Failed to start gauge API: Error occurred while waiting for runner process to finish.
Error : exit status 1
Get Support ----------------------------
Docs: https://docs.gauge.org
Bugs: https://github.com/getgauge/gauge/issues
Chat: https://spectrum.chat/gauge
Your Environment Information -----------
windows, 1.1.1, 6e0d83f
html-report (4.0.12), java (0.7.9), python (0.3.11), screenshot (0.0.1), xml-report (0.2.3)
Does someone know how this happens and how to solve it? Here are some additional informations:
Java version:14.0.2
Gauge version: 1.1.1
Maven version: 3.6.3
I just resolve the problem.
You should check your project's gauge.log. The Traceback is in the file, that will help you.
Don`t see the output, it will not work.

JOGL errors on compilation

I am working with JOGL and it stopped working completely.
These are the errors i get:
Texture01.java:27: error: cannot access WriteCloneable
canvas = new GLCanvas(glcapabilities);
^
class file for com.jogamp.common.type.WriteCloneable not found
.\Texture01_GLEventListener.java:2: error: package com.jogamp.common.nio does not exist
import com.jogamp.common.nio.*;
^
.\Texture01_GLEventListener.java:136: error: cannot find symbol
FloatBuffer fb = Buffers.newDirectFloatBuffer(vertices);
^
symbol: variable Buffers
location: class Texture01_GLEventListener
.\Texture01_GLEventListener.java:163: error: cannot find symbol
IntBuffer ib = Buffers.newDirectIntBuffer(indices);
^
symbol: variable Buffers
location: class Texture01_GLEventListener
4 errors
The Path and Classpath variables are correct, I reinstalled JDK and JOGL2 but still get an error with WriteClonable and com.jogamp.common.nio.*
Any help is appreciated!

error: package com.google.android.gms.games does not exist

My imports are :
import com.google.android.gms.games.Games;
import com.google.example.games.basegameutils.GameHelper;
I get this error in Android Studio
error: package com.google.android.gms.games does not exist
error: package com.google.example.games.basegameutils does not exist
Error:(87, 75) error: package GameHelper does not exist
Error:(116, 13) error: cannot find symbol class GameHelper
Error:(122, 28) error: cannot find symbol class GameHelper
Error:(230, 14) error: package Games does not exist
Error:(235, 14) error: package Games does not exist
Error:(242, 41) error: package Games does not exist
Error:(252, 41) error: package Games does not exist
Error:(259, 5) error: method does not override or implement a method from a supertype
Error:(263, 5) error: method does not override or implement a method from a supertype
>Error:Execution failed for task ':android:compileDebugJava'.
> Compilation failed; see the compiler error output for details.
I have the BaseGameUtil imported as a module, and trying to integrate GPSS
I am also using Libgdx and updated the gradle to
include 'desktop', 'android', 'ios', 'core', 'BaseGameUtil'
So any ideas on what I did wrong?
You must import google-play-services_lib as a library of your project.
You can find this at the following path:
<your-android-sdk-directory</extras/google/google_play_services/libproject/google-play-services_lib
See this guide

Play framework Documentation Task List Example Error

In Browser:
Compilation error
error: cannot find symbol
In /home/william/fmj/app/controllers/Application.java at line 28.
24 public static Result deleteTask(Long id) {
25 return TODO;
26 }
27
28 static Form<Task> taskForm = form(Task.class);
29
In Terminal:
[error] static Form<Task> taskForm = form(Task.class);
[error] ^
[error] symbol: class Task
[error] location: class Application
[error] /home/william/fmj/app/controllers/Application.java:16: error: cannot find symbol
[error] views.html.index.render(Task.all(), taskForm)
[error] ^
[error] symbol: variable Task
[error] location: class Application
[error] /home/william/fmj/app/controllers/Application.java:28: error: cannot find symbol
[error] static Form<Task> taskForm = form(Task.class);
[error] ^
[error] symbol: class Task
[error] location: class Application
[error] 3 errors
[error] {file:/home/william/fmj/}fmj/compile:compile: javac returned nonzero exit code
Any Help is greatly appreciated. I copy and pasted the code off of the tutorial (http://www.playframework.org/documentation/2.0.2/JavaTodoList) I'm not sure what's going wrong and I'd really like to learn this technology!
Apparently you didn't import Task model into your Application controller
You have 3 solutions:
Import each model manually:
import models.Task;
import exactly all models into your controller (it will be the best at the beginning, but...)
import models.*
Most recommended: Use some IDE which knows when and how to import required packages and classes and suggest you what should be imported (or not) (ie. IntelliJ Idea - just suggestion)
I got the same problem (error: cannot find symbol), sure that I have
import models.*;
but the error is still there.
I'm using eclipse 4.2, and it just suggest create new method form(Class<Task>

Categories

Resources