I have developed a android application . which is about maintaining the house . i have work with firebase in that application. now the problem is when i install that app in my android phone via usb cable from android studio it's run perfectly. but if i want share the app with someone via share it it's not working. (app not installed) a error come, why . ?? even if i am generate signed apk from android studio then it's also showing the same error . why ? any solution please.
and here the manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sonalirod.alwayswhite">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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" />
<application
android:allowBackup="true"
android:icon="#mipmap/lastfinalw"
android:label="#string/app_name"
android:roundIcon="#mipmap/lastfinalw"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Firstscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Login" />
<activity android:name=".Interface" />
<activity android:name=".MainActivity" />
<activity android:name=".Bazar_Data_Input" />
<activity android:name=".MealEntry" />
<activity android:name=".Suggestion" />
<activity android:name=".admininterface" />
<activity android:name=".ALogin" />
<activity android:name=".AdminloginEnter" />
<activity android:name=".Showalldeposit"></activity>
</application>
</manifest>
gradle settings
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.sonalirod.alwayswhite"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
and i am trying to install in android 4.4.2 (api 19-20)
CommonsWare explained it all.
https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html
Distributing APKs outside of GooglePlay to users need then to accept installing from Unknow Sources.
This options is under Settings > Security.. "Unknow sources"
Based in the link form other answer:
"
Android Studio 3.0 sets android:testOnly="true" on APKs that are run from the IDE
For many developers, this is of little consequence. However, if you have ever taken an APK lying around your build/ directory and sent it to somebody, that will only work if you did something other than run the app in Android Studio in order to create that APK, such as:
Built the app using the “Build APK(s)” menu option
Built the app using the assembleDebug or assembleRelease Gradle tasks
Built the app using something else that might use those tasks, such as a CI server
"
Are you building the application as release right?
Related
I'm using Embarcadero's Delphi 10.4 and trying to create an app deployed to an Amazon Fire which is using Android's 9 (API level 28) OS. No matter what I try, every time I try and run the project, I get an error reading "No resource identifier found for attribute 'requestLegacyExternalStorage' in package 'android'".
My Build.Gradle file is targeting the OS's API level. I did try setting both the compile and target SDK versions to 29 though to see if it made a difference.
...
compileSdkVersion 28
defaultConfig {
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
externalNativeBuild {
cmake.arguments '-DANDROID_TOOLCHAIN=clang',
'-DANDROID_STL=c++_static',
'-DANDROID_PLATFORM=android-22'
}
}
...
My AndroidManifest is targeting my API level but again I tried 29 as well. I've also tried setting the 'requestLegacyExternalStorage' attribute to true and false. If I delete the attribute from the manifest then it'll successfully compile but then the second the splash screen appears on my device, the connection crashes in my IDE with no errors reported and the splash screen stays on my device screen... I can set a breakpoint and see that the Application.Initialize never even executes.
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.embarcadero.WhsScanner"
android:versionCode="1"
android:versionName="1.0.0"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="WhsScanner"
android:debuggable="True"
android:largeHeap="False"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true"
android:resizeableActivity="false"
android:requestLegacyExternalStorage="false">
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="WhsScanner"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="WhsScanner" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
The SDK elements I'm using are as follows... Should all be up to date.
Android SDK Tools rev 25.2.5
Android SDK Platform-tools rev 29.0.6
Android SDK Build Tools rev 29.0.3
and then, of course, I have all SDK properties pointing to the API level 28 configuration files.
I can't even create a blank application!! PLEASE HELP!
I fixed the same problem in this way:
project compile and building.
find AndroidManifest.xml in my project build-out folder
move to my project source folder
modify AndroidManifest.xml with notepad to remove
remove android:requestLegacyExternalStorage="false"
Rad studio menu Project -> Deployment
uncheck original AndroidManifest.xml
add AndroidManifest.xml from Project Source Folder( step #3,4 file )
Save Project
Compile and Building...
(addition)
you don't need to copy and modify, deply changing AndroidManifest.xml from Build folder. Modify AndroidManifest.template.xml in your source folder. compile and build your source. that's all.
I think this process is more simple.
I'm working on a small Android Wear OS app and am pretty close to a release version.
The app is built in Android Studio using the Wear OS application template and it currently has just the one Activity (MainActivity).
Up to now I have been building a debug variant without any problems. I didn't need to tweak anything to make that work.
But now I am trying to build a release variant I am getting the following error:
Error: MainActivity must extend android.app.Service [Instantiatable]
My AndroidManifest.xml is as follows and it's the <service android:name="MainActivity" that is flagging as the error in the editor with MainActivity underlined in red:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.DeviceDefault">
<uses-library
android:name="com.google.android.wearable"
android:required="true" />
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="true" />
<!-- Recommended for Android 9 (API level 28) and lower. -->
<!-- Required for Android 10 (API level 29) and higher. -->
<service
android:name="MainActivity"
android:foregroundServiceType="location" >
<!-- Any inner elements would go here. -->
</service>
<activity
android:name=".MainActivity"
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>
My MainActivity currently extends Activity
public class MainActivity extends Activity {
I have no idea how to resolve this... it doesn't make sense to me that the debug variant builds and runs fine but the release variant doesnt.
The only release build specific stuff in my build.gradle is:
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
When I switch back to the debug variant the app build and runs perfectly on both an AVD Wear OS device and on an actual device.
I am making an app and the apk file that I am installing on my phone(API 23) using USB is not supporting on other devices(I have shared the apk and try to install it on a device of API 25).But another apk can be installed on that device using USB which is again not supporting on my phone.So,the apk of my app is not compatible.
And one more thing,the layouts are becoming different in different devices and sometimes 2 images are overlapping in one while in another device it is completely fine.
So I want to increase the compatibility of my app. Please help me out.
My manifest.xml file:
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ankush.anthroplace.anthroplace">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".AboutUsActivity" />
<activity android:name=".TestimonialActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" />
<activity
android:name=".ServicesActivity"
android:label="#string/title_activity_services"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".FormActivity"></activity>
</application>
</manifest>
Check the API level you are targeting on your project.
If you're working with Android Studio, look on the file "build.gradle (Module: app)" and change the "minSdkVersion" attribute.
The lower the number you set on that attribute, the more compatible will be your app, but you should loose some features as well.
try to put minimum sdk API level 19.
by targeting minimum apk level 19 your app will run on approximately more than 90% of android devices.
and compile your app with the latest build tool
you can change minimum sdk version from build.gradle file
android {
compileSdkVersion 26
defaultConfig {
applicationId "profile.com.demotest"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Check Android Dashboard you will get better idea about choosing minimum api level
Hi guys this is the first update I make to my app... I was reading and noticed that I need to change the versionCode and versionNameof my app in the manifest.xml, I did this and click on Build-> Generate Signed APK then in the developer console select my app and in the left menu click on APK then upload new APK and select my new generated APK but I keep getting the same error:
Upload error You must use another version code for your APK because
you already have a file with the version code 1.
BUT I don't know why I'm getting this error this is my manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ve.net.gorydev.bachaqueofamilia"
android:versionCode="2"
android:versionName="1.1">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
what should I change?? remember this is my first update
The versionCode and versionName are also defined in your app/build.gradle; define them there and you should have no problems.
android {
defaultConfig{
versionCode 2
versionName "1.1"
}
}
Below manifest formation I am using into my project but whenever I am trying to run my emulator, I am getting below mentioned error. please give me a exact solution for solving the error.
Tools informations
Android studio
Nexus S API 22 (android 5.1.1)
My Manifest file formate
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.info.androidapp" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="app"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<!-- Splash activity -->
<activity
android:name=".SplashActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Login activity -->
<activity
android:name=".LoginActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
<!-- List activity -->
<activity
android:name=".listActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
</application>
</manifest>
My Error :
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.info.androidapp/.SplashActivity }
Error type 3
Error: Activity class {com.example.info.androidapp/com.example.info.androidapp.SplashActivity} does not exist.
NOTE : Sometimes I am facing Unfortunately, the process com.android.phone has stopped alert into emulator!
After searching it for so long what helped me was.
1) File -> Sync Project with Gradle Files.
Or
This helped me too.
2) Uninstalling the previous installed application from emulator/mobile and re-run it and install it again.
Uninstall your app via 'adb' in the terminal: adb uninstall com.example.yourapp
I had to uninstall the app for all users.
If you have multiple users (e.g. a kids mode) on your device, uninstalling the app from homescreen only removes the app form the current user.
Go to Settings -> Apps -> (Your App) -> Open Popup Menu (by clicking on the three dots in top right corner) -> Uninstall for all Users
In build.gradle, the line:
apply plugin: 'android-library'
needs changed to:
apply plugin: 'android'
Edit:
Solution is deprecated. Please use this:
apply plugin: 'com.android.application'
try this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.info.androidapp" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="app"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".SplashActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Login activity -->
<activity
android:name=".LoginActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
<activity
android:name=".listActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
</application>
</manifest>
your Main Launcher activity always should be only ONE Activity.
Include the applicationId configuration in build.gradle if it doesn't already exist.
android {
compileSdkVersion 18
buildToolsVersion '19.0.0'
defaultConfig {
applicationId 'com.myapp.app'
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
The solution to my problem was to uninstall an app from the app (Settings) folder in android because the app was just disabled.
I thing other solutoions will work fine for few user in my case i am using android 9 and i have multi user option enabled for system, it automatically install application for guest user, so goto
Settings>Apps>Concern App
And you will see uninstall for all user option at the top Option Menu. Uninstall and everything will work fine.
in my case this error sparsely appears in one project only and I can resolve it only uninstalling the app. the simplest way is to use Gradle:
ProjName->Tasks->install->uninstallAll
The Uninstall your app via 'adb' in the terminal: adb uninstall com.example.yourapp
worked fine for me