I am following a tutorial and developing an Android game using AndEngine and Physics Box2D Extension. In a while I found out that there was a problem with (eclipse or) Physics Box2D Extension. Eclipse shows multiple errors in following
Package: org.andengine.extension.physics.box2d
Classes:
FixedStepPhysicsWorld.java
PhysicsConnector.java
PhysicsConnectorManager.java
PhysicsFactory.java
PhysicsWorld.java
Example errors:
The hierarchy of the type FixedStepPhysicsWorld is inconsistent, The import org.andengine.engine cannot be resolved
Package: org.andengine.extension.physics.box2d.util
Class: Vector2Pool.java
Example errors:
The import org.andengine.util cannot be resolved, GenericPool cannot be resolved to a type
I tried to post some screenshots to make the case more clear but I can't. Thanks in advance.
I had these error a lot of times.
you should check that you use same andengine version for the extension(GLES1.0,GLES 2.0 or GLES 2.0 AC).
2.If you do have same version, delete all of them from eclipse and try to import them back and than clean them.
Hope it works.
Related
I am trying to learn Minecraft modding, and while following a tutorial for version 1.16.4, I found that their code did not work, and I presume this is a change to the API, since I am using 1.16.5.
I have looked at both official and unofficial API docs, but these did not provide me any insight. Could anyone point me to a better API reference, or better yet, to a VSCode extension that autocompletes for the most recent Forge API.
Here is the compile error when I ran ./gradlew.bat build with my minimal reproducible example (sorry about the code highlighting, I don't know how to fix it):
C:\Users\eric\Desktop\Programming\Java\Minecraft Mod 1\src\main\java\com\ericl5445\testmod1\core\init\ItemInit.java:1: error: package net.minecraftforge.item does not exist
import net.minecraftforge.item.Item;
^
C:\Users\eric\Desktop\Programming\Java\Minecraft Mod 1\src\main\java\com\ericl5445\testmod1\core\init\ItemInit.java:2: error: package net.minecraftforge.item does not exist
import net.minecraftforge.item.ItemGroup;
^
Here is my full code:
TestMod1.java
ItemInit.java
Any help would really be appreciated!
I do not have an api reference, however I have found that the ItemGroup class is not under net.minecraftforge.item. It is under the package net.minecraft.item.
Your IDE, usually Intellij Idea or Eclipse, should be able to tell you where these classes are located via a search functionality. In Eclipse, you can press Control/Command + Shift + T to bring up a search box with a list of all the classes in your workspace.
The Package You Need To import is net.minecraft.item.Item and net.minecraft.itemGroup,
Not net.minecraftforge.item.Item and net.minecraftforge.itemGroup
After migrating to android x via android studio getting annotation issues (What is the easy way to migrate) Does the migration is necessary for any android project?
How can I easily migrate the app in android studio.
error: package android.support.annotation does not exist
import android.support.v4.util.ArrayMap;
See the class mappings:
android.support.annotation should rather be: androidx.annotation.
And you probably still have (the wrong one) support libraries referenced; eg:
implementation "com.android.support:support-v4:28.0.0"
Should rather be:
// https://mvnrepository.com/artifact/androidx.legacy/legacy-support-v4/1.0.0
implementation "androidx.legacy:legacy-support-v4:1.0.0"
The same goes for the annotations:
https://mvnrepository.com/artifact/androidx.annotation/annotation/1.1.0
implementation "androidx.annotation:annotation:1.1.0"
all of the references need to be updated.
I installed Vaadin on IntelliJ, using the trial mode of 14 days. I created a Vaadin 8 design including several UI components, yet they cannot be resolved. In particular, for these lines of code
import com.vaadin.annotations.AutoGenerated;
import com.vaadin.annotations.DesignRoot;
import com.vaadin.ui.declarative.Design;
import com.vaadin.ui.CustomComponent;
I get the messages 'Cannot resolve symbol ui' and 'Cannot resolve symbol annotations'. The lines were automatically generated after I created the .html file of the design, along with the lines
#DesignRoot
#AutoGenerated
in my code. That means I have a vaadin package than can be located, yet it doesn't include the annotations and the ui components. What am I supposed to do?
Thank you in advance
PS: I am using Fedora, if it plays any role
I am working on a project where I am trying to implement ExoPlayer to replace a VideoView. My issue is that I am getting this error: cannot find symbol class ProgressiveMediaSource
I have seen Why can't I locate ProgressiveMediaSource? and note that it is mentioned that ProgressiveMediaPlayer was added in ExoPlayer 2.10.0 - I am using 2.10.1 so version shouldn't be an issue. The other condition that was mentioned was having the Android project upgraded to AndroidX. I believe that I am only using AndroidX unless one of my dependencies is importing some support libraries (com.android.support).
The compiler throws an error on import:
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
If providing my gradle build script would help, let me know.
Error was due to human transcription error. I had typed progessive instead of progressive and never noticed until much later 😫
Lesson: if a symbol can't be found, make sure you spelled it correctly.
I am developing an android app which process speech and I have speech basic project (dependency for android project) ready on JAVA so I compiled JAVA project in eclipse in JAVA 7 compiler and exported that java project as a runnable jar.
I put this jar into my android studio project's libs folder and by right clicking selected AS A library, I got build successful message. But when I try run the android project it gives me error saying,
FATAL EXCEPTION: main Process: in.automator.automator, PID: 4242
java.lang.NoClassDefFoundError: jar_filename.Storage.class_in_jar_file
but the said class is there in the jar file, the only doubtful thing is the mentioned class file looks something like this
import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioFormat.Encoding;
import marf.util.InvalidSampleFormatException;
public class MARFAudioFileFormat extends AudioFileFormat {
....
...
....
}
It refers javax.sound.sampled, so possibly that might causing the problem.
I tried searching on the google for the problem but didn't got the solution which can resolve the issue. I tried everything.
I am using JRE 7 in android studio and exporting java project in Compiler & itself.
How to resolve this error?
Thanks in advance.
You are correct, the problem lies in the fact that the library you're trying to depend on, in turn depends on the javax package hierarchy. Android does not provide javax, so those classes don't exist at runtime (even though they do exist in your computer's JDK, so your compiler doesn't complain - it's basically the same as not having a particular DLL installed that a program on your PC needs).
The NoClassDefFoundError is being thrown on the class that first references the invalid class dependencies, which is probably what's confusing. That class may indeed actually exist in your jar, but it requires classes that don't exist in order to complete its definition - so in effect, your class is not fully defined.
The only way around this is to figure out a way to do whatever you're after, without the javax namespace. I have heard of a few attempts to try to port javax.* into Android, but they never end well - many of the javax classes end up boiling down to native calls, which also won't exist on Android.