The application is not installed when I try to authorize

I have an automatic update in my application that updates itself, I start this activity as follows:

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 that when I try to install it, he said: "The application is not installed." I was looking for information about this, and people said that I have to change the version code and version name, and I did it, but it still doesn't 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! 
0
source share
2 answers

Solved thanks to OcuS to help me with the solution

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

-1
source

The problem is that you are trying to install an application with an unsigned APK .

You HAVE sign the APK, even if it's a debug build, or if you don't put it on Google Play.

When you start the application from eclipse, it will be signed - even if you do not see the signing process - with your debug.keystore .

ALL applications MUST be signed before installing them on the device. ALWAYS. This is no exception.

+2
source

Source: https://habr.com/ru/post/1488647/


All Articles