SORU
29 HAZİRAN 2014, Pazar


-App fatura, Sınıftır Google: Servis Niyet açık, L Dev Önizleme Android yükseltme sonra olmalı

In-app fatura kodumu Android L geliştirici Önizleme yükseltilmiş kadar gayet iyi çalışıyordu. Şimdi benim app başladığında bu hatayı alıyorum. Herkes bu neden L hakkında neler değişti, ya da benim kod bunu düzeltmek için değiştirmem gerektiğini nasıl biliyor mu?

android {
compileSdkVersion 'android-L'
buildToolsVersion '20'
defaultConfig {
    minSdkVersion 13
    targetSdkVersion 'L'
...
...


compile 'com.google.android.gms:play-services:5. '
compile 'com.android.support:support-v13:21. '
compile 'com.android.support:appcompat-v7:21. '
...
...

App başladığında hata:

06-29 16:22:33.281    5719-5719/com.tbse.wnswfree D/AndroidRuntime﹕ Shutting down VM
06-29 16:22:33.284    5719-5719/com.tbse.wnswfree E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.tbse.wnswfree, PID: 5719
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tbse.wnswfree/com.tbse.wnswfree.InfoPanel}: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2317)
        at android.app.ActivityThread.access$800(ActivityThread.java:143)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5070)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:836)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:631)
 Caused by: java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=com.android.vending.billing.InAppBillingService.BIND }
        at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1603)
        at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1702)
        at android.app.ContextImpl.bindService(ContextImpl.java:1680)
        at android.content.ContextWrapper.bindService(ContextWrapper.java:528)
        at com.tbse.wnswfree.util.IabHelper.startSetup(IabHelper.java:262)
        at com.tbse.wnswfree.InfoPanel.onStart(InfoPanel.java:709)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1217)
        at android.app.Activity.performStart( Activity.java:5736)
        at android.app.ActivityThread.performLaunchActivity( ActivityThread.java:2218)
        at android.app.ActivityThread.handleLaunchActivity( ActivityThread.java:2317)
        at android.app.ActivityThread.access$800( ActivityThread.java:143)
        at android.app.ActivityThread$H.handleMessage( ActivityThread.java:1258)
        ...

İçinde InfoPanel.java: çizgi 709

        mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
          @Override
          public void onIabSetupFinished(IabResult result) {
            ...

CEVAP
19 Kasım 2014, ÇARŞAMBA


Aynı sorun bende de vardı ve açıkça paket ayarı çözüldü. Alekseyev'in cevap benzer, ama daha basit:

Intent intent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
// This is the key line that fixed everything for me
intent.setPackage("com.android.vending");

getContext().bindService(intent, serviceConnection, Context.BIND_AUTO_CREATE);

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • ASUS

    ASUS

    22 EKİM 2005
  • H3Ctic (old channel)

    H3Ctic (old

    23 Mart 2011
  • LearnKey

    LearnKey

    19 AĞUSTOS 2008