Problem installing APK automatically into target board - java

I'll post my code if needed, but currently the only problem I'm facing is that I cannot insert the file path into InputStream.
I'm working on vendor directory,
The logic is quite simple
I use BroadcastReceiver to get USB_ATTACHED intent
start InstallPackage.class(my code) to install apk in usb
in my AndroidManifest,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.innopia.systemcontrolreceiver"
android:versionCode="2"
android:versionName="0.0.0.1"
android:sharedUserId="android.uid.system"
>
<uses-feature android:name="android.hardware.usb.host" />
<uses-sdk android:minSdkVersion="23" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.REBOOT" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true">
<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>
<activity android:name = ".InstallPackage">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name= "com.innopia.systemcontrolreceiver.SystemControlReceiver" android:enabled="true" android:requestLegacyExternalStorage="true" android:exported="true" android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/device_filter" />
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED" />
</intent-filter>
and in res/xml/provider_paths
<paths>
<root-path name="root" path="."/>
</paths>
I tried
"/mnt/media_rw/XXXX-XXXX",
"/storage/XXXX-XXXX",
and a lot of other methods which also didn't work
need help desperately, have been working on this for days.
In my log it says
ENOENT cannot find file

Related

Getting error after updating android studio to 3.2

We are facing an error of default activity is not found after update android studio to version "3.2". On another PC, which is running lower version 3.1.4 of android studio, this same application is working. If anyone has a solution then please suggest us.
I have attached manifest file of screen shot of android studio for that error.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.exmple.com">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="portrait" >
</activity>
<activity android:name=".Category_item"
android:screenOrientation="portrait"/>
<activity android:name=".ImageDatail"
android:screenOrientation="portrait"/>
<activity android:name=".SplashScreen"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.VIEW"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="your-own-uri" />
</intent-filter>
</activity>
<service android:name=".FireBase.MyFirebaseMessagingService"
android:exported="true"
android:stopWithTask="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name=".FireBase.MyFirebaseInstanceIDService"
android:exported="true"
android:stopWithTask="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<receiver
android:name=".Util.ConnectivityReceiver"
android:enabled="true">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.qualifiedapps.inspirationalquotes.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths" />
</provider>
</application>
</manifest>

Android icon missing when uploading to playstore

When I install my application it's working fine, the icon is displayed and have no issues, however when installing the application on the device from the apk it does not show the application name, it shows the package with no icon, when uploading to playstore it gives me an error stating I should add an icon to the application.
This use to work until recently.
ic_launcher icon file does exist.
my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.package">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="android.support.multidex.MultiDexApplication">
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<activity
android:name="com.my.package.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.my.package.LoginActivity"
android:label="#string/title_activity_login"
android:theme="#style/Theme.CustomTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.my.package.NotificationsActivity"
android:label="#string/title_activity_login"
android:theme="#style/AppThemeNoti"></activity>
<service android:name="com.my.package.FirebaseService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="com.my.package.FirebaseToken">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="keyhere" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
I found the problem:
<application
android:name="android.support.multidex.MultiDexApplication">
I removed the > after MultiDexApplication. Figured the android:icon was greyed out and hence not working.
Thanks.

Android Studio Manifest Start and End Tags

I just recently started programming, and encountered a problem. My code seems fine, but Android Studio matches different start tags with end tags. This is my code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="330" android:versionName="3.3 beta" package="com.example.furmanthelegend.nocrastinationapp">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.GET_TASKS" android:maxSdkVersion="24" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.sensor.stepcounter" android:required="false" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<application android:theme="null" android:label="NoCrastination" android:icon="res/drawable-mdpi-v4/ic_launcher.png" android:name="de.dfki.nocrastination.utils.NoCrastinationApplication" android:allowBackup="true">
<activity android:label="NoCrastination" android:name="de.dfki.nocrastination.ui.activities.MainActivity" android:excludeFromRecents="true">
<intent-filler>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filler>
</activity>
<activity android:label="Add New Condition" android:name="de.dfki.nocrastination.ui.activities.AddConditionsActivity" android:excludeFromRecents="true" />
<activity android:label="Condition" android:name="de.dfki.nocrastination.ui.activities.ConditionDetailActivity" android:excludeFromRecents="true" />
<activity android:label="App Information" android:name="de.dfki.nocrastination.ui.activities.appinformationActivity" android:excludeFromRecents="true" />
<activity android:label="Recently Used Apps" android:name="de.dfki.nocrastination.ui.activities.previousappsActivity" android:excludeFromRecents="true" />
<activity android:label="Credits" android:name="de.dfki.nocrastination.ui.activities.creditsActivity" android:excludeFromRecents="true" />
<activity android:label="Settings" android:name="de.dfki.nocrastination.ui.activities.settingsactivity" android:excludeFromRecents="true" />
<activity android:name="org.wordpress.passcodelock.PasscodeUnlockActivity" android:windowSoftInputMode="stateHidden" />
<activity android:name="org.wordpress.passcodelock.PasscodeManagePasswordActivity" android:windowSoftInputMode="stateHidden" />
<service android:name="de.dfki.nocrastination.logging.BackgroundService" android:enabled="true" android:exported="false" />
<reciever android:name="de.dfki.nocrastination.logging.BootCompleteReceiver" android:enabled="true" android:exported="false" />
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</reciever>
<provider android:label="NoCrastination" android:name="de.dfki.nocrastination.data.NoCrastinationProvider" android:exported="false" android:authorities="de.dfki.appdetox" />
<service android:label="NoCrastination Laws" android:icon="res/drawable-xhdpi-v4/dcw_ic_extension.png" android:name="de.dfki.nocrastination.dashclockextension.nocrastinationExtension" android:permission="com.google.android.appa.dashclock.premission.READ_EXTENSION_DATA">
<intent-filler>
<action android:name="com.google.android.apps.dashclock.Extension" />
</intent-filler>
<meta-data android:name="protocolVersion" android:value="1" />
<meta-data android:name="description" android:value="Shows current amount of active conditions and condition breaks" />
</service>
<service android:label="NoCrastination" android:name="de.dfki.nocrastination.logging.AppUsageAccesibilityService" android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE" android:enabled="true" >
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data android:name="android.accessibilityservice" android:resource="res/xml/accessibility_service_config.xml" />
</service>
<meta-data android:name="com.crashlytics.ApiKey" android:value="c5cac52287e9abe392fe06e567285ee4aa9ed0bb" />
<receiver android:label="NoCrastination&apos;s device admin" android:name="de.dfki.nocrastination.ui.activities.DeviceAdminSample" android:permission="android.permission.BING_DEVICE_ADMIN" android:description="Prevent stop forcefully">
<meta-data android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<intent-filler>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filler>
</receiver>
</application>
<manifest>
I am not great at programming, so any tips would be extremely appreciated and helpful. The main problem is that android studio matches and other cases like that.
you use inline close tag and outline also just remove the (/) from the reciever tag, to be:
<reciever android:name="de.dfki.nocrastination.logging.BootCompleteReceiver" android:enabled="true" android:exported="false"> ==> removed "/"
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</reciever>
And add "/" to the last line to be

Build Failed, Missing Key Attribute (Android SDK)

I recently imported my project over from Eclipse ADT over to Android SDK. I'm trying to re-run my simulator but I am encountering a problem with my AndroidManifest.xml file which states: /Users/####/Documents/android/medicine/src/main/AndroidManifest.xml:13:13-30 Error: Missing one of the key attributes 'action#name,category#name' on element intent-filter at AndroidManifest.xml:13:13-30
I searched on Google for the error but haven't come up with anything solid. Is there a reason for this error, I am assuming it is because of the Android version? Any help on this would be great.
Below is my AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest android:hardwareAccelerated="true" android:versionCode="20101" android:versionName="2.1.1" android:windowSoftInputMode="adjustPan" package="com.medicine" xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true" android:icon="#drawable/icon" android:label="Med Finder">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="#string/app_name" android:launchMode="singleTop" android:name="Medicine" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:label="#string/app_name" android:name="org.pgsqlite.SQLitePlugin">
<intent-filter />
</activity>
<receiver android:exported="true" android:name="com.google.ads.conversiontracking.InstallReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
<intent-filter>
<action android:name="com.medicine.MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/app_id" />
<receiver
android:name="com.pushbots.google.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.medicinefinder" />
</intent-filter>
</receiver>
<receiver android:name="com.pushbots.push.DefaultPushHandler" />
<service android:name="com.pushbots.push.GCMIntentService" />
</application>
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="19" />
<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" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission android:name="com.medicine.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.medicine.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive dataf message. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation|screenSize"/>
</manifest>
check your these lines :
<activity android:label="#string/app_name" android:name="org.pgsqlite.SQLitePlugin">
<intent-filter />
</activity>
here you define intent filter but not any action so if you don't want to specify any action there just delete it or add any action that you want to listen,

Android Google Maps V2 Blank Screen

With Android 4.0.4 Google Maps API V2 shows nothing (blank white screen). It works with Android >4.1, so the API key is correctly configured.
There are some Warnings in Logcat, but they also occur on Android >4.1, where everything works fine.
01-11 16:39:03.325: E/GooglePlayServicesUtil(6470): The Google Play services resources were not found.
Check your project configuration to ensure that the resources are included.
Here is my project's manifest : (eclipse build target is google APIs 19)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.hska"
android:versionCode="17"
android:versionName="2.0.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<!-- PERMISSIONS -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Needed for GmapsApi v2 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-feature
android:name="android.hardware.telephony"
android:required="false" />
<application
android:name="de.hska.HsKAmpusApp"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/HskaTheme" >
<provider
android:name="de.hska.util.BuildingSuggestionProvider"
android:authorities="de.hska.util.BuildingSuggestionProvider.search_suggestion_provider"
android:syncable="false" />
<!-- Activities -->
<activity
android:name="de.hska.gui.activity.SplashActivity"
android:enabled="true"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
<activity
android:name="de.hska.gui.activity.SmallScreenActivity"
android:enabled="true" >
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
<activity
android:name="de.hska.gui.activity.BigScreenActivity"
android:enabled="true" >
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
</activity>
<activity
android:name="de.hska.gui.activity.SelectScheduleActivity"
android:enabled="true"
android:noHistory="false" >
</activity>
<activity
android:name="de.hska.gui.activity.PersonDetailMapActivity"
android:enabled="true"
android:label="#string/title_activity_map" >
</activity>
<!-- Services -->
<service
android:name="de.hska.controller.FileService"
android:exported="false" />
<service android:name="de.hska.service.UpdateService" />
<service android:name="de.hska.service.GradeService" />
<service
android:name="de.hska.auth.AccountAuthenticatorService"
android:exported="true"
android:process=":auth" >
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
<!-- Receivers -->
<receiver
android:name="de.hska.receiver.GradeJobScheduler"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" >
</action>
<action android:name="de.hska.gradeBroadcast" />
</intent-filter>
</receiver>
<receiver android:name="de.hska.receiver.GradeReceiver" >
<intent-filter>
<action android:name="android.intent.extra.ALARM_COUNT" />
</intent-filter>
</receiver>
<receiver android:name="de.hska.receiver.UpdateReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" >
</action>
<action android:name="de.hska.updateBroadcast" />
</intent-filter>
</receiver>
<receiver android:name="de.hska.receiver.ProgressReceiver" >
<intent-filter>
<action android:name="android.intent.extra.ALARM_COUNT" />
</intent-filter>
</receiver>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<!-- Google Maps v2 API Key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />
</application>
</manifest>
Here's the google play services manifest: (eclipse build target is Google APIs level 19)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms"
android:versionCode="4030530"
android:versionName="4.0.30 (889083-30)" >
<uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="19" />
</manifest>

Categories

Resources