Piashsarker / AndroidAppUpdateLibrary

Android App Update Library can be used for downloading the Apk from a link , Save it to External or Internal Storage, Than automatic installing the apk. Remember to add provider xml and android runtime permission before using this library. See sample use in app folder.
MIT License
121 stars 43 forks source link

Update Error #2

Closed nowfalsalahudeen closed 6 years ago

nowfalsalahudeen commented 6 years ago

Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference

Piashsarker commented 6 years ago

Did you add the Provider in the res => xml folder with the specific name ?

nowfalsalahudeen commented 6 years ago

i already put this.. found on your code

external-path name="external_files" path="."
nowfalsalahudeen commented 6 years ago

yep i already did that..but didnt worked..file downloaded successfully.after that this error occurs

nowfalsalahudeen commented 6 years ago

screenshot from 2018-01-17 11-47-17

nowfalsalahudeen commented 6 years ago

Sory bro ..it was my mistake.i just forgot to update manifest file

Piashsarker commented 6 years ago

Add below code in your manifest.xml file .


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

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <application
        ..........................................................
        <provider
            android:name="android.support.v4.content.FileProvider"
            android:authorities="${applicationId}.provider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/provider_paths"/>
        </provider>

    </application>

</manifest>```
Piashsarker commented 6 years ago

Thanks @nowfalsalahudeen , I am closing the issue as it's fixed . Happy Coding.

neethuantony42 commented 4 years ago

Hi @Piashsarker , I have used the code to update the app but i could only download the app in server but when i tried to install the same i am getting the error App not install. Could you please help to solve the issue.

Thanks and Regards, Neethu

Piashsarker commented 4 years ago

@neethuantony42
Can you please share the logcat or Screenshot.