将模块添加到React Native - 错误:找不到符号

时间:2016-09-07 12:09:42

标签: android react-native

我想在我的React Native应用程序中添加一个简单的模块。但我有一个错误:

binary64

以下是代码:

:app:compileDebugJavaWithJavacE:\project\android\app\src\main\java\com\androiddepends\HelloWorld.java:23: error: cannot find symbol
    Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
    ^
  symbol:   class Intent
  location: class HelloWorld
E:\project\android\app\src\main\java\com\androiddepends\HelloWorld.java:23: error: cannot find symbol
    Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
                        ^
  symbol:   class Intent
  location: class HelloWorld
E:\project\android\app\src\main\java\com\androiddepends\HelloWorld.java:23: error: cannot find symbol
    Intent intent = new Intent(Intent.ACTION_WIFI_SETTINGS);
                               ^
  symbol:   variable Intent
  location: class HelloWorld
E:\project\android\app\src\main\java\com\androiddepends\HelloWorld.java:24: error: cannot find symbol
    if (intent.resolveActivity(getPackageManager()) != null) {
                               ^
  symbol:   method getPackageManager()
  location: class HelloWorld
4 errors
 FAILED

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

你应该导入android SDK的意图包,这是在导入部分找不到的。

  

android.content.Intent

问题是SDK找不到Intent类。