Android 签名apk中的Youtube数据api错误?

Android 签名apk中的Youtube数据api错误?,android,youtube,youtube-api,Android,Youtube,Youtube Api,我正在尝试实现从android应用程序向youtube频道添加订阅的功能 我已经完成了: 在开发者控制台上注册应用程序-完成 包名称和SHA-1证书指纹-多恩 使用“”进行Google帐户身份验证-完成 注意:功能在调试模式下工作正常 问题:当我在play store上创建用于发布应用程序的已签名apk时,订阅按钮不工作,每次都会抛出不同的错误 i、 具有不受限制的api密钥的e: W/System.err: { "c" : 0, "errors" : [ { "domain"

我正在尝试实现从android应用程序向youtube频道添加订阅的功能

我已经完成了:

  • 在开发者控制台上注册应用程序-完成
  • 包名称和SHA-1证书指纹-多恩

  • 使用“”进行Google帐户身份验证-完成

  • 注意:功能在调试模式下工作正常

    问题:当我在play store上创建用于发布应用程序的已签名apk时,订阅按钮不工作,每次都会抛出不同的错误

    i、 具有不受限制的api密钥的e

    W/System.err: {
    "c" : 0,
       "errors" : [ {
        "domain" : "global",
         "reason" : "required",
         "message" : "Required parameter: part",
        "locationType" : "parameter",
       "location" : "part"
       } ],
       "code" : 400,
       "message" : "Required parameter: part"
     } 
    
    这是我正在做的代码

      // Initialize credentials and service object.
            mCredential = GoogleAccountCredential.usingOAuth2(getApplicationContext(), Arrays.asList(SCOPES)).setBackOff(new ExponentialBackOff());
    
     HttpTransport transport = AndroidHttp.newCompatibleTransport();
    
                        JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
    
    
                        YouTube mService = new YouTube.Builder(transport, jsonFactory, mCredential)
                                .setApplicationName(getResources().getString(R.string.app_name))
                                .setYouTubeRequestInitializer(new YouTubeRequestInitializer(Config.KEY))
                                .build();
    
    
     channelId = myListModel.getYoutubeChannelId();
    // Create a resourceId that identifies the channel ID.
                            ResourceId resourceId = new ResourceId();
                            resourceId.setChannelId(channelId);
                            resourceId.setKind("youtube#channel");
    
    
     // Create a snippet that contains the resourceId.
                            SubscriptionSnippet snippet = new SubscriptionSnippet();
                            snippet.setResourceId(resourceId);
    
                            // Create a request to add the subscription and send the request.
                            // The request identifies subscription metadata to insert as well
                            // as information that the API server should return in its response.
                            Subscription subscription = new Subscription();
    
                            subscription.setSnippet(snippet);
    
                            YouTube.Subscriptions.Insert subscriptionInsert = mService.subscriptions().insert("snippet,contentDetails", subscription);
    
                            try {
                                Subscription returnedSubscription = subscriptionInsert.execute();
    
                                // Print information from the API response.
                                System.out.println("\n================== Returned Subscription ==================\n");
    
                                System.out.println("  - Id: " + returnedSubscription.getId());
    
                                System.out.println("  - Title: " + returnedSubscription.getSnippet().getTitle());
    
                                addSubscriber(myListModel);
    
                            } catch (UserRecoverableAuthIOException mLastError) {
    
                                startActivityForResult(mLastError.getIntent(), REQUEST_AUTHORIZATION);
    
                            }
    
                        } catch (GoogleJsonResponseException e) {
                            System.err.println("GoogleJsonResponseException code: " + e.getDetails().getCode() + " : "
                                    + e.getDetails().getMessage());
                            e.printStackTrace();
    
    
                        } catch (IOException e) {
                            System.err.println("IOException: " + e.getMessage());
                            e.printStackTrace();
    
                        } catch (Throwable t) {
                            System.err.println("Throwable: " + t.getMessage());
                            t.printStackTrace();
    
                        }
    

    你找到解决办法了吗