Package does not exist - android/java

MiguelD

I ran into this weird problem that happens when i try to run a unit test for one of my app classes: "package does not exist".

If i run the app i get the same error, but if i press "run" again it compiles and works just fine, i have also made another unit test for another class and the same process repeats i run it the first time, get the error, run it again and it compiles. But for some reason when i run this new unit test in particular i get the same error and does not compile.

Here is the particular code generating the error:

package chess_game;
import org.junit.Test;
import pieces.*;
import static org.junit.Assert.*;
public class GameTest {
    @Test
    public void enPassantLegalMoves(){

        ...

        Piece bking = new King(PieceColour.BLACK);
        bd[3][2].setPiece(bking);

        Piece bpawn = new Pawn(PieceColour.BLACK);
        bpawn.setHasMovedAlready(true);
        bd[4][4].setPiece(bpawn);

        Piece wking = new King(PieceColour.WHITE);
        bd[7][4].setPiece(wking);

        Piece wpawn = new Pawn(PieceColour.WHITE);
        wpawn.setHasMovedAlready(true);
        bd[4][3].setPiece(wpawn);

        ...
    }
}

enter image description here The error

Note: I dont know if its relevant but i am using android studio and the IDE doesn`t give any warnings besided the compiling error.

Thanks in advance.

Crammeur

I think is the project structure.

you need to put your package pieces in the chess_game package. Not in chess_game (test)

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Ant package org.junit does not exist

分類Dev

error: package android.test does not exist

分類Dev

package javax.annotation.security does not exist

分類Dev

@ComponentScan does not exist in org.springframework.context.annotation package

分類Dev

Simple gradle build failing due to `package ... does not exist`

分類Dev

gradle compileJava error: package org.junit does not exist

分類Dev

Javadoc generation "error package does not exist" in multi module project

分類Dev

Java import jar file: package func does not exist

分類Dev

error: package com.getcapacitor.community.firebasecrashlytic does not exist

分類Dev

package android.support.v7.internal.view.menu does not exist: cannot find symbol class MenuBuilder

分類Dev

Why does volatile exist?

分類Dev

Why does volatile exist?

分類Dev

Animation getTexture() does not exist?

分類Dev

Class Controller does not exist

分類Dev

"X" does not exist in this context

分類Dev

Does Zend Flashdata exist?

分類Dev

The "X" argument does not exist

分類Dev

Laravel 2 instances of BadMethodCallException: 'int does not exist' and 'method does not exist'

分類Dev

'Property does not exist on type 'never'

分類Dev

Does attribute node exist in HTML?

分類Dev

Does copy elision exist in C?

分類Dev

Does splice exist for TypedArrays or is there an equivalent?

分類Dev

TypeScript '...' does not exist on type 'typeof ...'

分類Dev

Why forEach does not exist on NodeListOf

分類Dev

Sonarqube Branch does not exist on server

分類Dev

Property 'xxx' does not exist on type '{}'

分類Dev

The member does not exist? Powershell script

分類Dev

Git Remote showing but does not exist

分類Dev

Laravel - method whereDate does not exist

Related 関連記事

ホットタグ

アーカイブ