When i import this
libgdx class com.badlogic.gdx.backends.android.AndroidLiveWallpaper
I get the following error:
com.badlogic.gdx.backends.android.AndroidLiveWallpaper is not visible.
What causes and how can I solve it?
Related
I got this error when I was launching my app in the emulator does anybody know whats wrong sorry I am kind of new to android studio
lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html'
import 'dart:html' as html;
But I did everything correctly it's RIGHT THERE
import 'dart:async';
import 'dart:io' as io;
import 'package:file/file.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:flutter/material.dart';
import 'package:telegramchatapp/Widgets/FullImageWidget.dart';
import 'package:telegramchatapp/Widgets/ProgressWidget.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'dart:html' as html;
You can not import dart:html in app for mobile (android or iOS). Remove it.
If you want use it for web application, you can use conditional import explained here.
I'm trying to get some java 1.8 code working in Java 11. I've hit what seems to be a common wall, but none of the answers I've found are working.
System: Fedora 33 5.9.8-200.fc33.x86_64
Eclipse Version: 2020-09 (4.17.0) Build id: 20200910-1200
JDK: java-11-openjdk-11.0.9.11-0.fc33.x86_64
JavaFX: OpenFX javafx-sdk-11.0.2
Here's the bit of code that's blocking me.
class MyPie extends PieChart {
public Legend legend;
public MyPie() {
super();
legend = (Legend) getLegend();
}
}
The error is: "Legend cannot be resolved to a type" When I ask Eclipse to auto-generate an import statement, or use the suggestion, it put in this line:
import com.sun.javafx.charts.Legend;
This is a problem, because that doesn't seem to exist and doesn't follow the same pattern as the other JavaFX imports:
import javafx.scene.chart.PieChart;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.TextField;
I have a second one "com.sun.javafx.css.StyleManager" which I'm guessing will have the same solution.
What am I missing here?
Thanks.
After updating Katalon Studio to 5.9.1, we occasionally get java.lang.ClassNotFoundException: cz.elektLabs.Keywords on our custom keyword class while running tests in Jenkins.
What is weird is that it doesn't happen every time and we are not able to reproduce it. It worked before in 5.7.
Here is beginning of our custom keyword class:
package cz.elektLabs
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import org.openqa.selenium.By
import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.util.KeywordUtil
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import groovy.json.JsonSlurper
import groovy.time.TimeCategory
import internal.GlobalVariable
class Keywords {
#Keyword
def boolean checkIfValidImage(String url) {
...
}
...
}
And here is the error we get:
2018-12-14 09:18:53.987 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ? cz.elektLabs.Keywords
2018-12-14 09:18:53.988 ERROR c.k.katalon.core.main.TestCaseExecutor - ? cz.elektLabs.Keywords.openAndLogin() FAILED.
Reason:
java.lang.ClassNotFoundException: cz.elektLabs.Keywords
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestSystem.run(TestSystem:17)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:321)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:312)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:291)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:283)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:222)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1544775530390.run(TempTestSuite1544775530390.groovy:36)
Is there anything we could do to fix this issue?
edit: We updated Katalon Studio to version 5.10.1 and we are still getting ClassNotFoundException or NoClassDefFoundError every now and then.
Please make sure you have installed Open JDK 1.8 on the machine.
This question already has answers here:
IntelliJ: Never use wildcard imports
(14 answers)
Closed 5 years ago.
Goal:
Say I have a line of code: payout.setPayoutStatusType(PayoutStatusType.REJECTED); but PayoutStatusType is not imported in the models which currently look like this:
import models.ApprovedLead;
import models.IdentityProviderType;
import models.ImportJob;
import models.ImportJobStatus;
import models.Offer;
import models.OfferSource;
import models.OfferViewedStatus;
import models.PaymentAccount;
import models.PaymentAccountType;
import models.PayoutStatusType;
import models.Payout;
import models.PendingPayout;
import models.RawOffer;
import models.User;
import models.UserDevice;
import models.UserDeviceType;
import models.UserOffer;
My issue is if I click on PayoutStatusType, and have it create the import for this it will remove all the static imports, and just do it in one line: import models.* which I don't want it to do.
My question is this: How do I set up my IDE which is Intellij to just make it import models.PayoutStatusType
You can configure the threshold above which IntelliJ starts to 'import *':
Preferences > Editor > Code Style > Java > Imports > Class count to use import with '*'
It looks like your latest import has exceeded this threshold thereby causing IntelliJ to collapse numerous imports under a *.
My error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: org.jbox2d.common.Timer.now()D
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:130)
Caused by: java.lang.UnsatisfiedLinkError: org.jbox2d.common.Timer.now()D
at org.jbox2d.common.Timer.now(Native Method)
at org.jbox2d.common.Timer.reset(Timer.java:35)
at org.jbox2d.common.Timer.<init>(Timer.java:31)
at org.jbox2d.dynamics.World.<init>(World.java:587)
at org.jbox2d.dynamics.World.<init>(World.java:158)
at org.jbox2d.dynamics.World.<init>(World.java:154)
at org.jbox2d.dynamics.World.<init>(World.java:145)
at com.badlogic.gdx.physics.box2d.World.<init>(World.java:61)
at com.example.blockbunny.states.Play.<init>(Play.java:22)
at com.example.blockbunny.handlers.GameStateManager.getState(GameStateManager.java:36)
at com.example.blockbunny.handlers.GameStateManager.pushState(GameStateManager.java:46)
at com.example.blockbunny.handlers.GameStateManager.<init>(GameStateManager.java:20)
at com.example.blockbunny.main.Game.create(Game.java:33)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:146)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:123)
And this occurs when I do this:
world = new World(new Vector2(0, -9.81f), true);
I have looked online, and some solutions included using this:
import com.badlogic.gdx.utils.GdxNativesLoader;
GdxNativesLoader.load();
However, I don't know where to put this function, and if it even works (I tried putting it in several different places)
How can I fix this issue?
Help will be appreciated, thanks!
As requested, here are my imports:
import static com.example.blockbunny.handlers.B2DVars.PPM;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.physics.box2d.Body;
import com.badlogic.gdx.physics.box2d.BodyDef;
import com.badlogic.gdx.physics.box2d.BodyDef.BodyType;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.FixtureDef;
import com.badlogic.gdx.physics.box2d.PolygonShape;
import com.badlogic.gdx.physics.box2d.World;
import com.example.blockbunny.handlers.GameStateManager;
import com.example.blockbunny.main.Game;
I used Box2d several time with libgdx and i never encountered such a problem :
here what i propose t you :
GdxNativesLoader.load();
should be put on the create() method, but that doesn't seem to work with you
also try call it in a static way like this :
static {
GdxNativesLoader.load();
}
but i thin your problem is the extension of the library that you are using
verify that you are using gdx-box2d and not gdx-box2d-gwt which is used only for Html project
Verify that you are using the right (jar file) /(extension library) : gdx-box2d.jar and gdx-box2d-natives.jar (also verify the build path)
also try :
upgrade the box2d version that you're using
those were all the arrows i had ! hope one of it will work
Good luck !!
I came across the same issue, was using the gwt libraries. Updated the Maven dependency artifact from
gdx-box2d-gwt
to
gdx-box2d
and it fixed the error.