我是Google Drive Integration Application的新手。我正在尝试将此代码集成到quickstart android google drive示例中。
但是我收到了这个错误:
The method permissions() is undefined for the type Drive
代码:
try {
return service.permissions().insert(fileId, newPermission).execute();
} catch (Exception e) {
System.out.println("An error occurred: " + e);
}
我正在导入import com.google.android.gms.drive.Drive
;而不是import com.google.api.services.drive.Drive
;
取自......完整代码Google drive share api ..
编辑一:
当我尝试导入
时import com.google.api.services.drive.Drive;
import com.google.api.services.drive.model.Permission;
我正面临packagename
附近的另一个问题问题:
The type com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient cannot be resolved. It is indirectly referenced from required .class files
有人可以帮助我吗?感谢