2016-08-30 58 views
0

林遠銷試圖打電話給我的Android應用程序中的第三方服務意向權限,但它返回的錯誤:不允許啓動服務意向不不UID

java.lang.SecurityException: Not allowed to start service Intent { act=com.othercompany.SERVICE_INTENT flg=0x3 cmp=com.mycompany.package/com.othercompany.service.CoreService (has extras) } without permission not exported from uid 10107

服務的意圖,我想打電話完全在我的應用程序外部,因此我無法訪問它的代碼或清單文件。

我的代碼如下:

 buttonPress.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 
      Intent talkButtonDown = new Intent(PRESS_CLASS); 
      talkButtonDown.setClassName(PACKAGE, "com.othercompany.service.CoreService"); 
      talkButtonDown.putExtra(RESTART_EXTRA, true); 
      talkButtonDown.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); 
      talkButtonDown.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION); 
      startService(talkButtonDown); 
     } 
    }); 

我已閱讀其他職位約在外部應用程序的清單·需要「出口=真正的」,但我有這個清單的訪問權限。 還有什麼可以拋出這個錯誤?任何幫助將不勝感激。 乾杯。

回答

2

Is there anything else that could be throwing this error?

否。該服務未導出。它專門用於託管服務的應用程序,而不是其他應用程序直接調用。

你可能會考慮聯繫有問題的公司,看他們是否有一個記錄和支持的API來處理他們的Android應用程序。

+0

嗯,我希望事實並非如此。 我會聯繫開發人員,並確保他們的一切都沒問題。 非常感謝。 – samuelmadethis