首页 > 解决方案 > > 任务:app:compileDebugJavaWithJavac 失败

问题描述

我正在使用以下类从我的应用程序直接调用。

网址:https ://github.com/wumke/react-native-immediate-phone-call

即使我按照上述所有步骤操作,也不允许我打电话。

当我尝试组装我的构建时,请参阅以下错误。

Task :app:compileDebugJavaWithJavac FAILED
/Users/MQ/pinnacle/android/app/src/main/java/com/pinnacle/MainActivity.java:19: error: cannot find symbol
        RNImmediatePhoneCallPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); // very important event callback
                                   ^
  symbol:   method onRequestPermissionsResult(int,String[],int[])
  location: class RNImmediatePhoneCallPackage
1 error

FAILURE: Build failed with an exception.

想从我的 react native 应用程序直接调用

import com.github.wumke.RNImmediatePhoneCall.RNImmediatePhoneCallPackage;

...

public class MainActivity extends ReactActivity {

...

@Override
    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
        RNImmediatePhoneCallPackage.onRequestPermissionsResult(requestCode, permissions, grantResults); // very important event callback
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    }

}

标签: reactjsreact-native

解决方案


您添加的库中存在一些链接问题。重新安装库并尝试手动链接它们。


推荐阅读