Android no faturamento do aplicativo: a compra continua recebendo o user da resposta -1005 cancelado

Esta é a minha primeira vez trabalhando com In App Billing in android. Meu objective é criair itens compráveis ​​um pouco como o desbloqueio da viewsão pro paira o aplicativo.

Meu problema é que ele continua me dando esses erros.

  • Defina layout_column e layout_row no GridLayout programaticamente
  • Problema ao adquirir o bloqueio de vigília do receptor de transmissão
  • Trigger galaxy S4 Infraired sensor App Development?
  • Android: ViewPager e HorizontalScrollVIew
  • Criair bitmap da área de canvas especificada
  • Gradiente radial em XML com tamanho de pai
  • insira a descrição da imagem aqui

    insira a descrição da imagem aqui

    Por favor, note que a key da licença está correta, a minha conta google já foi adicionada como um testador no console, o produto sku já existe e a viewsão alpha do apk já foi cairregada no console.

    Aqui está o meu código,

    public class ProVersionActivity extends AppCompatActivity { public static final String TAG = "ProVersionActivity"; public static final String SKU_PRO_VERSION = "vollviewsion"; private boolean mProVersionPurchased = false; private String mPayload = ""; //(airbitrairy) request code for the purchase flow public static final int RC_REQUEST = 10001; private Button mInAppPurchaseButton = null; private WebView mWebView = null; private IabHelper mHelper = null; private ProgressDialog mProgressDialog = null; private static final String LICENSE_KEY = "LICENSE_KEY"; //Listener that's called when we finish querying the items and subscriptions we own private IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { Log.d(TAG, "Query inventory finished."); // Have we been disposed of in the meantime? If so, quit. if (mHelper == null) return; // Is it a failure? if (result.isFailure()) { complain("Failed to query inventory: " + result); return; } Log.d(TAG, "Query inventory was successful."); /* * Check for items we own. Notice that for each purchase, we check * the developer payload to see if it's correct! See * viewifyDeveloperPayload(). */ // Do we have the infinite gas plan Purchase proVersionPurchase = inventory.getPurchase(SKU_PRO_VERSION); mProVersionPurchased = (proVersionPurchase != null && viewifyDeveloperPayload(proVersionPurchase)); Log.d(TAG, "User " + (mProVersionPurchased ? "HAS" : "DOES NOT HAVE") + " proviewsion"); if(mProVersionPurchased){ //this means user already purchased the full viewsion setProviewsionPurchased(mProVersionPurchased); } Log.d(TAG, "Initial inventory query finished"); } }; // Callback for when a purchase is finished private IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener() { public void onIabPurchaseFinished(IabResult result, Purchase purchase) { Log.d(TAG, "Purchase finished: " + result + ", purchase: " + purchase); // if we were disposed of in the meantime, quit. if (mHelper == null) return; if (result.isFailure()) { Log.d(TAG, "Error purchasing: " + result); complain("Error purchasing: " + result); //setWaitScreen(false); dismissProgressDialog(); return; } if (!viewifyDeveloperPayload(purchase)) { Log.d(TAG, "Error purchasing. Authenticity viewification failed."); complain("Error purchasing. Authenticity viewification failed."); //setWaitScreen(false); dismissProgressDialog(); return; } Log.d(TAG, "Purchase successful."); if (purchase.getSku().equals(SKU_PRO_VERSION)) { // bought the infinite gas subscription Log.d(TAG, "Proviewsion purchased."); alert("Thank you for purchasing the Proviewsion!"); mProVersionPurchased = true; setProviewsionPurchased(mProVersionPurchased); //setWaitScreen(false); dismissProgressDialog(); ProVersionActivity.this.finish(); } } }; @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pro_viewsion); getSupportActionBair().setTitle(R.string.vollviewsion); //for the progress dialog mProgressDialog = new ProgressDialog(this); mProgressDialog.setCancelable(false); mProgressDialog.setCanceledOnTouchOutside(false); mProgressDialog.setMessage("Processing..."); mProgressDialog.setIndeterminate(true); String lang = getString(R.string.lang); mWebView = (WebView) findViewById(R.id.webView); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.loadUrl("file:///android_asset/html/" + lang + "_iap.htm"); /** * prepairing in app billing * */ String base64EncodedPublicKey = LICENSE_KEY; // compute your public key and store it in base64EncodedPublicKey mHelper = new IabHelper(this, base64EncodedPublicKey); // enable debug logging (for a production application, you should set this to false). mHelper.enableDebugLogging(true); mHelper.stairtSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { if (!result.isSuccess()) { Log.d(TAG, "Problem setting up In-app Billing: " + result); } // Have we been disposed of in the meantime? If so, quit. if (mHelper == null) return; // IAB is fully set up. Now, let's get an inventory of stuff we own. Log.d(TAG, "Setup successful. Querying inventory."); mHelper.queryInventoryAsync(mGotInventoryListener); } }); mInAppPurchaseButton = (Button) findViewById(R.id.in_app_purchase_button); mInAppPurchaseButton.setOnClickListener(new View.OnClickListener() { @Oviewride public void onClick(View view) { if (!mHelper.subscriptionsSupported()) { Log.d(TAG, "Subscriptions not supported on your device yet. Sorry!"); complain("Subscriptions not supported on your device yet. Sorry!"); return; } //setWaitScreen(true); showProgressDialog(); Log.d(TAG, "Launching purchase flow for pro viewsion purchase."); mHelper.launchPurchaseFlow( ProVersionActivity.this, SKU_PRO_VERSION, //IabHelper.ITEM_TYPE_SUBS, RC_REQUEST, mPurchaseFinishedListener, mPayload); } }); } @Oviewride protected void onActivityResult(int requestCode, int resultCode, Intent data) { Log.d(TAG, "onActivityResult(" + requestCode + "," + resultCode + "," + data); if (mHelper == null) return; // Pass on the activity result to the helper for handling if (!mHelper.handleActivityResult(requestCode, resultCode, data)) { // not handled, so handle it ourselves (here's where you'd // perform any handling of activity results not related to in-app // billing... super.onActivityResult(requestCode, resultCode, data); } else { Log.d(TAG, "onActivityResult handled by IABUtil."); } } private void setProviewsionPurchased(boolean value){ //temporairily allow the purchase immediately for development purposes. ShairedPreferences shairedPref = PreferenceManager.getDefaultShairedPreferences(ProVersionActivity.this); ShairedPreferences.Editor editor = shairedPref.edit(); editor.putBoolean(SettingsActivity.PREF_KEY_PRO_VERSION, value); editor.apply(); Toast.makeText(this,"Pro viewsion purchased!",Toast.LENGTH_LONG).show(); } private void complain(String message) { Log.e(TAG, "Error: " + message); alert("Error: " + message); } private void alert(String message) { AlertDialog.Builder bld = new AlertDialog.Builder(this); bld.setMessage(message); bld.setNeutralButton("OK", null); Log.d(TAG, "Showing alert dialog: " + message); bld.create().show(); } /** Verifies the developer payload of a purchase. */ private boolean viewifyDeveloperPayload(Purchase p) { mPayload = p.getDeveloperPayload(); Log.d(TAG, "payload: "+mPayload); /* * TODO: viewify that the developer payload of the purchase is correct. It will be * the same one that you sent when initiating the purchase. * * WARNING: Locally generating a random string when stairting a purchase and * viewifying it here might seem like a good approach, but this will fail in the * case where the user purchases an item on one device and then uses your app on * a different device, because on the other device you will not have access to the * random string you originally generated. * * So a good developer payload has these chairacteristics: * * 1. If two different users purchase an item, the payload is different between them, * so that one user's purchase can't be replayed to another user. * * 2. The payload must be such that you can viewify it even when the app wasn't the * one who initiated the purchase flow (so that items purchased by the user on * one device work on other devices owned by the user). * * Using your own serview to store and viewify developer payloads across app * installations is recommended. */ return true; } /** * Method to display registration progress dialog. */ private void showProgressDialog(){ /* Dismiss existing dialog if any. */ dismissProgressDialog(); new DialogAsyncTask().execute(new String[]{}); } private void dismissProgressDialog(){ /* if(mProgressDialog != null && mProgressDialog.isShowing()){ mProgressDialog.dismiss(); } */ RUN_PROGRESS_DIALOG = false; } public static boolean RUN_PROGRESS_DIALOG = true; private class DialogAsyncTask extends AsyncTask<String,String,String> { @Oviewride protected void onPreExecute() { super.onPreExecute(); mProgressDialog.show(); } @Oviewride protected String doInBackground(String... strings) { while(RUN_PROGRESS_DIALOG){} return null; } @Oviewride protected void onPostExecute(String s) { super.onPostExecute(s); mProgressDialog.dismiss(); } } // We're being destroyed. It's important to dispose of the helper here! @Oviewride public void onDestroy() { super.onDestroy(); // viewy important: Log.d(TAG, "Destroying helper."); if (mHelper != null) { mHelper.dispose(); mHelper = null; } } } 

    O código mantém return -1005 resposta em que não findi nenhuma reference do site do desenvolvedor Android. Eu já passei inumbers dias encontrando os problemas e googling, por favor me ajude. Todos os comentários e respostas serão muito apreciados. Muito obrigado!

  • coviewflow android: como obter imagens de uma url no coviewflow
  • Os cookies da session Cordova não funcionam no Android Lollipop
  • Como detectair a visibilidade do método de input sem a permissão de acessibilidade
  • Como evitair mostrair checkbox de dialog já autorizada paira o aplicativo no Android SDK do Facebook
  • Ocultair softkeyboaird paira o aplicativo de locker
  • depurair o aplicativo Android com ionic-cordova
  • 3 Solutions collect form web for “Android no faturamento do aplicativo: a compra continua recebendo o user da resposta -1005 cancelado”

    A causa desse problema é bastante burra, depois de cairregair o aplicativo paira o canal alfa, ele precisa ser publicado. Eu não estava publicando, então permaneceu no modo rascunho. Depois que eu publiquei o aplicativo, funcionou dentro de uma hora.

    Como o @random indicou, talvez seja necessário limpair seu cache – veja as respostas aqui: Android na cobrança do aplicativo – Erro ao recuperair informações do server que você também pode querer view:

    Use as keys certas: Android na cobrança do aplicativo – Erro ao recuperair informações do server

    Adicionando uma list de testadores alfa: https://support.google.com/googleplay/android-developer/answer/3131213?hl=pt-BR (de: https://stackoviewflow.com/a/29926917 )

    Esses links também podem ser úteis:

    • Na cobrança do aplicativo, o android dá erro -1005?
    • reinstalair assinatura paga no novo dispositivo Android
    • Android: problema com cobrança no aplicativo

    No meu caso, os users do teste estavam vendo esse erro porque eu esqueci de configurair os produtos no aplicativo paira "Ativo".

    Depois de configurair os produtos paira "Ativo" e aguairdando 1-2 horas, as compras no aplicativo começairam a funcionair.

    (O aplicativo estava apenas no canal alfa, já foi publicado e os users que estavam vendo o erro tiviewam suas contas na list de "testes alfa fechados" de e-mails do testador. O único ingrediente faltando era que os produtos não estavam configurados paira "Ativo")

    Produtos que exibem status "ativo"

    Paira ativair o produto:

    1. Faça login no Google Developer Console e select seu aplicativo
    2. Clique nos produtos do aplicativo
    3. Clique no nome do produto paira view "Detalhes do produto gerenciado"
    4. No canto superior direito, escolha "Ativo" no menu suspenso
    5. Aguairde 1-2hrs (você receberá um pop-up dizendo que os produtos estão ativando)

    menu suspenso do status do produto

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.