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

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

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.

import android.support.v4.app.ActivityCompat;

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.

Trouble opening new program in Android Studio

I recently downloaded Android Studio and attempted to open a new project. The code that is generated looks like this:
package com.example.trevo.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class GettingStarted extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_getting_started);
}
}
The tabs at the top of my screen (scr, main, java, com, example, trevo, myapplication, GettingStarted) are all underlined in red. Also the 'R' in the line setContentView(R.layout.activity_getting_started); is red and gets the error "cannot resolve symbol". When I try to run the program as written I get the following error.
C:\Users\trevo\Documents\Java4Android_Projects\MyApplication\app\src\main\res\layout\activity_getting_started.xml
Error:(13, 49) String types not allowed (at 'layout_constraintBottom_toBottomOf' with value 'parent').
Error:(14, 45) String types not allowed (at 'layout_constraintLeft_toLeftOf' with value 'parent').
Error:(15, 47) String types not allowed (at 'layout_constraintRight_toRightOf' with value 'parent').
Error:(16, 43) String types not allowed (at 'layout_constraintTop_toTopOf' with value 'parent').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Has anyone else had this problem with Android Studio? What can I do to remedy these errors?
This is a known bug in Android Studio, happened to my build too.
To resolve it, Clean Build the project and remove the import which has R in it, Android Studio will then import the correct R
This issue seems to be resolved in the latest 3.0 RC build

"error: package org.apache.commons.math3.random does not exist"?

I'm trying to compile a java code as in the following line :
javac -classpath /Users/tim/kws/code/library:/Users/moab/kws/code/commons-cli-1.2/commons-cli-1.2.jar:/Users/tim/kws/code/commons-math-2.2/commons-math-2.2.jar:/Users/tim/kws/code/common-math3-3.1.1/commons-math3-3.1.1.jar RATSWriteLandmarksFromPfile.java
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:17: error: package org.apache.commons.math3.random does not exist
import org.apache.commons.math3.random.RandomDataImpl;
^
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:50: error: cannot find symbol
private RandomDataImpl randomData_;
^
symbol: class RandomDataImpl
location: class LabelPfile
/Users/tim/kws/code/library/ppm/types/LabelPfile.java:321: error: cannot find symbol
randomData_ = new RandomDataImpl();
^
symbol: class RandomDataImpl
location: class LabelPfile
3 errors
does anybody know why am I getting these errors ?
Seems like you are missing the commons-math3 library.

Categories

Resources