需要权限啊,你要看详细提示,里面会提示具体缺少了哪个权限,然后在AndroidManifest.xml里面加入对应的权限就可以了。

解决方案 »

  1.   

    AndroidManifest.xml代码发上来看看
      

  2.   

    意思是你的service不需要权限设置,内部就可以调用,你把加的限制或者intent-filter去掉试试,不行就把
    注册的service配置文件贴出来看看
      

  3.   

    下面是代码:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.wind.musicplayer"
        android:versionCode="1"
        android:versionName="1.0" >    <uses-sdk android:minSdkVersion="15" />    <application
            android:icon="@drawable/icon"
            android:label="@string/app_name" >
            <activity
                android:name=".activity.MyMusicPlayerActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />                                <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
                
            </activity>
            
            <service android:name=".serviec.MusicPlayerService">
                <intent-filter>
                    <action android:name="com.wind.MusicService"/>
                    <action android:name="com.wind.serviceaction"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
                </intent-filter>
            </service>
            
        </application></manifest>
      

  4.   

    这是在Java类里面的代码:
    public static String PLAY_SERVICE = "com.wind.MusicService";
    startService(new Intent(MusicPlayerService.PLAY_SERVICE));
    下面是AndroidManifest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.wind.musicplayer"
      android:versionCode="1"
      android:versionName="1.0" >  <uses-sdk android:minSdkVersion="15" />  <application
      android:icon="@drawable/icon"
      android:label="@string/app_name" >
      <activity
      android:name=".activity.MyMusicPlayerActivity"
      android:label="@string/app_name" >
      <intent-filter>
      <action android:name="android.intent.action.MAIN" />     <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
        
      </activity>
        
      <service android:name=".serviec.MusicPlayerService">
      <intent-filter>
      <action android:name="com.wind.MusicService"/>
      <action android:name="com.wind.serviceaction"/>
      <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      </service>
        
      </application></manifest>
      

  5.   

    加上这个就可以了
      android:exported="false"
    比如: <service android:name="MusicService"  android:exported="false">
      

  6.   


    没用呀。我以前不会报这样的错
    后面升级了SDK 到19版就会这样子的现象
      

  7.   

    缺少权限限制
    这是一个可以被其他程序访问的Service,需要声明一个权限保护你的service
      

  8.   

    结过贴了也给你答案!
    就是同时在<service>和 <action>中加入android:exported="false",就可以了!如下:
    <service android:name=".serviec.MusicPlayerService" android:exported="false">
      <intent-filter>
      <action android:name="com.wind.MusicService"android:exported="false"/>
      <action android:name="com.wind.serviceaction"/>
      <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      </service>
      

  9.   

    我的也出现这个问题了 同时还有 can not dispatch DDM chunk ,Application is not installed on your phone 。
    最后把别的manifest文件拷过来才可以,但是我的activity 是最简单的,文件内容也都一样啊
      

  10.   


    在网上查到的:android:exported 这个属性用于指示该服务是否能够被其他应用程序组件调用或跟它交互。如果设置为true,则能够被调用或交互,否则不能。设置为false时,只有同一个应用程序的组件或带有相同用户ID的应用程序才能启动或绑定该服务。我想问在设置为true的情况下,如何使该服务被其他应用程序组件调用或交互呢,用AIDL吗?我写过AIDL的demo小程序也没有设置过这个属性啊。。
      

  11.   

    先在<manifest>标签下加入<permission android:protectionLevel="normal" android:name="oem.permission.SENDMAIL"></permission>然后在<service>标签下android:permission="oem.permission.SENDMAIL"  不解释~  你明白的~
      

  12.   

    <service />中定义了intent-filter的话,android:exported属性值默认为true,而你的<service />定义中没有指定访问权限,其他程序不需要申请权限便可以启动这个service,因而有这个安全警告。
      

  13.   

    只需要在用到service的地方换句代码
    startService(new  Intent(MainActivity.this,Service_Player.class));
      

  14.   

    然后把androidmanifest里面的<intent-filter>删掉就行
      

  15.   

    把 android:exported该改为 false 也不会有提示的,这种方法是限制外部访问,自然不需要权限了