我不得不说我第一次使用这个Android设备,但是我设置了USB调试。 这就像它第一次安装应用程序,然后它不会更新我做的任何更改。
因此,该应用程序适用于模拟器。
我将它安装在Xperia arc S(索尼爱立信)设备上并且它第一次工作。
然后我在清单中选择了一个不同的主要活动,我收到了这个错误
ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.moob/.InitialMenuActivity } from null (pid=7195, uid=2000) requires null
但它仍可在模拟器上运行!!我已经在移动设备上卸载了该应用,但随后出现了上述错误。
请注意,在移动设备上卸载并重新启动后,它会在清单更改之前重新安装可用的版本(我可以在手机上手动启动它,但它是旧版本)。
删除应用后
Installing duelos_android.apk...
Success!
Starting activity com.moob.InitialMenuActivity on device 42583930325432573634
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] cmp=com.moob/.InitialMenuActivity }
ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.moob/.InitialMenuActivity } from null (pid=7195, uid=2000) requires null
清单 -
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.moob"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".SingleDuelActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name=".MultiDuelActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name=".GameClientActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name=".LoadingActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name=".Ranking"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name=".LogginActivity"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.moob.FB.FriendsList"
android:screenOrientation="portrait"
android:label="@string/app_name" >
</activity>
<activity
android:name="com.moob.FB.Example"
android:label="@string/app_name" >
</activity>
<activity
android:name=".InitialMenuActivity"
android:screenOrientation="portrait"
android:exported="true"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
</manifest>
这里是LogCat
11-19 12:32:42.506: D/AndroidRuntime(7718): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
11-19 12:32:42.506: D/AndroidRuntime(7718): CheckJNI is OFF
11-19 12:32:42.506: D/dalvikvm(7718): creating instr width table
11-19 12:32:42.616: D/AndroidRuntime(7718): Calling main entry com.android.commands.pm.Pm
11-19 12:32:42.626: D/AndroidRuntime(7718): Shutting down VM
11-19 12:32:42.626: D/dalvikvm(7718): GC_CONCURRENT freed 101K, 71% free 299K/1024K, external 0K/0K, paused 1ms+1ms
11-19 12:32:42.626: D/dalvikvm(7718): Debugger has detached; object registry had 1 entries
11-19 12:32:42.626: I/AndroidRuntime(7718): NOTE: attach of thread 'Binder Thread #2' failed
11-19 12:32:42.746: D/AndroidRuntime(7728): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
11-19 12:32:42.746: D/AndroidRuntime(7728): CheckJNI is OFF
11-19 12:32:42.746: D/dalvikvm(7728): creating instr width table
11-19 12:32:42.866: D/AndroidRuntime(7728): Calling main entry com.android.commands.am.Am
11-19 12:32:42.866: I/ActivityManager(262): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.moob/.InitialMenuActivity } from pid 7728
11-19 12:32:42.866: W/ActivityManager(262): Permission denied: checkComponentPermission() reqUid=10158
11-19 12:32:42.866: W/ActivityManager(262): Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.moob/.InitialMenuActivity } from null (pid=7728, uid=2000) requires null
InitialMenuActivty(我不使用clickUno并点击它们不是来自我)
public class InitialMenuActivity extends Activity {
private static final String TAG = "TESTING";
//menu para ir a configuracion, jugar solo, ranking, puntuacion y multplayer
/*
*
*
* http://greendao-orm.com/
*
*
* */
private SQLiteDatabase db;
private DaoMaster daoMaster;
private DaoSession daoSession;
private LogroDao daoLogro;
private Cursor cursor;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainmenu);
}
public void clickUno(View target)
{
Log.d(TAG, "click 1");
DevOpenHelper helper = new DaoMaster.DevOpenHelper(this, "notes-db", null);
db = helper.getWritableDatabase();
daoMaster = new DaoMaster(db);
daoSession = daoMaster.newSession();
daoLogro = daoSession.getLogroDao();
final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
String comment = "logro en:" + df.format(new Date());
daoLogro.insert(new Logro(null,comment,new Date()));
/* List<Logro> logros=daoLogro.queryBuilder().list();
for (Iterator iterator = logros.iterator(); iterator.hasNext();) {
Logro logro = (Logro) iterator.next();
Log.d(TAG, "Logro::"+logro.getLogro_name()+"-"+String.valueOf(logro.getDate()));
}
*/
}
public void clickDos(View target)
{
Log.d(TAG, "click 2");
List<Logro> logros=daoLogro.queryBuilder().list();
for (Iterator iterator = logros.iterator(); iterator.hasNext();) {
Logro logro = (Logro) iterator.next();
Log.d(TAG, "Logro::"+logro.getLogro_name()+"-"+String.valueOf(logro.getDate()));
}
}
public void exempleFB(View target){
Intent t = new Intent(InitialMenuActivity.this, Example.class);
startActivity(t);
}
public void logginActivity(View target){
Intent t = new Intent(InitialMenuActivity.this, LogginActivity.class);
startActivity(t);
}
public void rankingActivity(View target){
//if (Utility.arrayListFriend != null){
Intent t = new Intent(InitialMenuActivity.this, Ranking.class);
startActivity(t);
}
public void singleDuelActivity(View target){
Intent t = new Intent(InitialMenuActivity.this, SingleDuelActivity.class);
startActivity(t);
}
public void multiDuelActivity(View target){
Intent t = new Intent(InitialMenuActivity.this, MultiDuelActivity.class);
startActivity(t);
}
}
答案 0 :(得分:0)
我自己并不专家,但是因为看起来它与Intent有问题,为什么不尝试将所有意图部分都注释掉。
我认为Emulators通常没有其他可以与之交互的应用程序(例如Facebook),所以可能是它忽略了那些意图,而你的物理设备正试图处理它们。
无能为力,但值得一试。
答案 1 :(得分:0)
好的,我必须清理项目并解决了问题...我仍然不知道为什么它在模拟器上工作但在移动设备上没有。