0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ReactNativeのMainActivity.javaとかで"class、interfaceまたはenumがありません"が出るときの対処

Last updated at Posted at 2022-05-29

症状

MainApplication.javaとかMainActivity.javaでこんなエラーが出る

...MainApplication.java:4: エラー: class、interfaceまたはenumがありません
package com.hoge.hoge;

(error: class, interface, or enum expected)

原因

packageが先頭じゃなくなってる

解決

packageを先頭に移動する

MainApplication/MainActivity.java
import hoge.fuga.hoge;
...
package com.hoge.hoge;
import hoge.piyo.hoge;
...

MainApplication/MainActivity.java
package com.hoge.hoge;
import hoge.fuga.hoge;
import hoge.piyo.hoge;
...
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?