错误:找不到符号:变量Build.VERSION_CODES.O_MR1

时间:2018-11-16 11:22:36

标签: android react-native react-native-android

我正在尝试实现一个本机模块,该模块在react native中提供连接服务。但是我面临一个错误。由于我不是一名android / java开发人员,因此无法找到以下错误的原因。

E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:10: error: cannot find symbol
    @TargetApi(Build.VERSION_CODES.O_MR1)
                                  ^
      symbol:   variable O_MR1
      location: class VERSION_CODES
    E:\projects\deets-mobile-cp\node_modules\react-native-connection-service\android\src\main\java\com\genm\CallConnection.java:14: error: cannot find symbol
            setConnectionProperties(PROPERTY_SELF_MANAGED);
                                    ^
      symbol:   variable PROPERTY_SELF_MANAGED
      location: class CallConnection

CallConnection.java

package com.genm;

import android.annotation.TargetApi;
import android.os.Build;
import android.telecom.Connection;
import android.util.Log;

import static android.content.ContentValues.TAG;

@TargetApi(Build.VERSION_CODES.O_MR1)
public class CallConnection extends Connection{

    public CallConnection(){
        setConnectionProperties(PROPERTY_SELF_MANAGED);
        setAudioModeIsVoip(true);
    }

    @Override
    public  void onAnswer(){
        Log.d(TAG, "On answer to the call");
    }

}

1 个答案:

答案 0 :(得分:2)

请确保您的{""}文件中有Get-ChildItem -Filter *.csv | Select-Object -ExpandProperty FullName | Import-Csv | Export-Csv .\merged\merged.csv -NoTypeInformation -Append

  

compileSdkVersion = 27是SDK级别,将用于编译您的   应用程式。如果您需要访问API 27上添加的属性或方法,则可以   需要相应地更新此值。这意味着,如果您需要访问(例如)build.gradle,则应设置compileSdkVersion,依此类推...