当我尝试不自动更新安装的应用程序当我、自动更新、应用程序

2023-09-07 03:29:30 作者:五行缺妳

我有我的应用程序的自动更新的更新自己,我开始练习这种方式:

 意向意图=新意图(Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(文件://+鲁塔+NameApp.apk),应用程序/ vnd.android.package归档);intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);mContext.startActivity(意向); 

问题是,当我尝试安装它,它说:没有安装应用程序我搜索有关这一点,人们说我必须改变版本code和版本的名字,我做到了,但仍然不工作,有是我的清单

 <?XML版本=1.0编码=UTF-8&GT?;<清单的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android包=com.name.name安卓版code =2机器人:=的versionName1.0><用途-SDK    安卓的minSdkVersion =8    机器人:targetSdkVersion =8/> <使用许可权的android:NAME =com.google.android.c2dm.permission.RECEIVE/> <使用许可权的android:NAME =android.permission.INTERNET对/> <使用许可权的android:NAME =android.permission.WAKE_LOCK/> <使用许可权的android:NAME =com.android.launcher.permission.INSTALL_SHORTCUT/> <使用许可权的android:NAME =com.name.name.permission.C2D_MESSAGE/> <使用许可权的android:NAME =android.permission.ACCESS_WIFI_STATE/> <使用许可权的android:NAME =android.permission.ACCESS_NETWORK_STATE/> <使用许可权的android:NAME =android.permission.ACCESS_COARSE_LOCATION/> <使用许可权的android:NAME =android.permission.ACCESS_FINE_LOCATION/> <使用许可权的android:NAME =android.permission.READ_PHONE_STATE/> <使用许可权的android:NAME =android.permission.WRITE_EXTERNAL_STORAG​​E/> <使用许可权的android:NAME =android.permission.SEND_SMS/> <使用许可权的android:NAME =android.permission.WRITE_SMS/> <使用许可权的android:NAME =android.permission.RECEIVE_SMS/> <使用许可权的android:NAME =android.permission.READ_SMS/> <使用许可权的android:NAME =android.permission.RESTART_PACKAGES/><应用    机器人:allowBackup =真    机器人:图标=@绘制/ ic_launcher    机器人:标签=@字符串/ APP_NAME    机器人:主题=@风格/ AppTheme>    <活动        机器人:名字=com.name.name.PantallaCarga        机器人:标签=@字符串/ APP_NAME>        &所述;意图滤光器>            <作用机器人:名字=android.intent.action.MAIN/>            <类机器人:名字=android.intent.category.LAUNCHER/>        &所述; /意图滤光器>    < /活性GT;    <活动机器人:名字=com.name.name.MainActivity机器人:screenOrientation =肖像>< /活性GT;    <活动机器人:名字=com.name.name.NoMiembros机器人:screenOrientation =肖像>< /活性GT;    <活动机器人:名字=com.name.name.ZonaMiembros机器人:screenOrientation =肖像>< /活性GT;    <活动机器人:名字=com.name.name.Pago机器人:screenOrientation =肖像>< /活性GT;    <活动机器人:名字=com.name.name.PlayvideofromserverActivity机器人:screenOrientation =肖像>< /活性GT;    <接收机器人:名字=com.google.android.gcm.GCMBroadcastReceiver                机器人:权限=com.google.android.c2dm.permission.SEND>        &所述;意图滤光器>            <作用机器人:名字=com.google.android.c2dm.intent.RECEIVE/>            <作用机器人:名字=com.google.android.c2dm.intent.REGISTRATION/>            <类机器人:名字=com.name.namex/>        &所述; /意图滤光器>    < /接收器>    <接收机器人。$的messageReceiver PetardoNAME =机器人:出口=真正的>        <意向过滤器的android:优先=999>        <作用机器人:名字=android.provider.Telephony.SMS_RECEIVED>< /作用>        &所述; /意图滤光器>    < /接收器>< /用途> 

日志猫:

  06-25 16:25:05.132:E / PackageParser(2510):包com.name.name有在入境RES /绘制/ boton_continuar_pago.png没有证书;无视! 
卸载了的应用程序,为什么市场还能自动更新安装

解决方案

解决了,感谢OCUS引导我到解决方案

问题是,认证是不一样的,当你唱APK,当你调试它,所以你需要手动通过APK安装它,然后,你就可以正常自动更新

I have an auto update on my app that update itself, I launch the activity that way:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse("file://"+ruta+"NameApp.apk"), "application/vnd.android.package-archive");
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);

the problem is when I try to install it it said "Application not installed" I searched information about this and the people said that I must change version code and version name and I did it but still doesnt work, there is my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.name.name"
android:versionCode="2"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="8" />

 <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.WAKE_LOCK" />
 <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
 <uses-permission android:name="com.name.name.permission.C2D_MESSAGE"  />
 <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
 <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.SEND_SMS" />
 <uses-permission android:name="android.permission.WRITE_SMS"/>
 <uses-permission android:name="android.permission.RECEIVE_SMS" />
 <uses-permission android:name="android.permission.READ_SMS" />
 <uses-permission android:name="android.permission.RESTART_PACKAGES"/>

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.name.name.PantallaCarga"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name="com.name.name.MainActivity" android:screenOrientation="portrait"></activity>
    <activity android:name="com.name.name.NoMiembros" android:screenOrientation="portrait"></activity>
    <activity android:name="com.name.name.ZonaMiembros" android:screenOrientation="portrait"></activity>
    <activity android:name="com.name.name.Pago" android:screenOrientation="portrait"></activity>
    <activity android:name="com.name.name.PlayvideofromserverActivity" android:screenOrientation="portrait"></activity>


    <receiver android:name="com.google.android.gcm.GCMBroadcastReceiver"
                android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
            <category android:name="com.name.namex" />
        </intent-filter>
    </receiver>

    <receiver android:name=".MessageReceiver$Petardo" android:exported="true">
        <intent-filter android:priority="999">
        <action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
        </intent-filter>
    </receiver>
</application>

log cat:

06-25 16:25:05.132: E/PackageParser(2510): Package com.name.name has no certificates at entry res/drawable/boton_continuar_pago.png; ignoring!

解决方案

Solved, thanks to OcuS to guide me to the solution

The problem was that the certification is not the same when you sing the apk, and when you debug it , so you need to pass manually the apk , install it and then, you can autoupdate normally