Bir uygulama yapıyorum ve Google Drive Android API'sını buna entegre ediyorum. Bir ana etkinliğim var ve bu da Google Drive'a açılan bir fragman. Ancak, oturum açmaya çalıştığımda (gmail hesabının ne olduğu önemli değil, var olanları denedim, yenilerini oluşturdum, ne olursa olsun) Bağlantı Sınama hatası kodu 17 SIGN_IN_FAILED. Uygulama geliştirici konsolunda yetkilidir ve Drive API'sı etkinleştirilmiştir. Yapılacak başka ne var bilmiyorum.Google Drive Android API Bağlantı Hatası Hata
public class FileSharingFragment extends Fragment implements
GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (mGoogleApiClient == null) {
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
}
mGoogleApiClient.connect();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View rootView = inflater.inflate(R.layout.fragment_file_sharing, container, false);
users = (TextView) rootView.findViewById(R.id.users);
getActivity().setTitle("Files");
return rootView;
}
@Override
public void onActivityResult(int requestCode, int resultCode,
Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_CODE_RESOLUTION && resultCode == Activity.RESULT_OK) {
mGoogleApiClient.connect();
}
}
@Override
public void onConnectionFailed(ConnectionResult result) {
Log.i(TAG, "GoogleApiClient connection failed: " + result.toString());
if (!result.hasResolution()) {
// show the localized error dialog.
GooglePlayServicesUtil.getErrorDialog(result.getErrorCode(), getActivity(), 0).show();
Log.i("file sharing fragment", "error code " + result.getErrorCode());
return;
}
try {
result.startResolutionForResult(getActivity(), REQUEST_CODE_RESOLUTION);
} catch (IntentSender.SendIntentException e) {
Log.e(TAG, "Exception while starting resolution activity", e);
}
}
Ve bana izin vermez neden beni hayat çözemiyorum için ben
Fragment fragment = FileSharingFragment.newInstance();
FragmentManager fragmentManager = getFragmentManager();
fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).commit();
kullandığımız ana etkinlikten aramak: Burada
ilgili koddur oturum açın.
[burada] doğru olarak verilen tüm adımları uyguladınız mı? (Https://developers.google.com/drive/android/auth#generate_the_signing_certificate_fingerprint_and_register_your_application)? – Exception
[bu yanıtı] gözden geçirin (http://stackoverflow.com/questions/21280794/error-connectionresultstatuscode-internal-error-resolution-null#22738951). – Exception