I am developing an app for a long time and now I'm trying to install generated apk on my phone, but there is error occurs. But it works fine when I run it on emulator or wi-fi adb connection with the phone. I'm already read a lot of manuals, but nothing helps me yet. I have no slightest idea why it's happening.
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.scapegoats.checkers">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".activity.game.Game" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.bluetooth.BluetoothMenu" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.session.SessionActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.createsession.CreateSessionActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.internet.InternetMenu" />
</activity>
<activity android:name=".activity.properties.Properties" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.internet.InternetMenu" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.autorization.AutorizationActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.registration.RegistrationActivity" android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".activity.main.Main" />
</activity>
<activity android:name=".activity.main.Main" 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>
</activity>
</application>
</manifest>
Here is my build gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "ru.scapegoats.checkers"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
checkReleaseBuilds false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
ext {
androidSupportVersion = "27.0.1"
gmsVersion = "12.0.1"
retrofitVersion = "2.1.0"
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0-alpha2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.0.0-alpha3'
testCompile 'junit:junit:4.12'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
implementation "com.squareup.retrofit2:retrofit:${retrofitVersion}"
implementation "com.squareup.retrofit2:converter-gson:${retrofitVersion}"
implementation "com.squareup.retrofit2:adapter-rxjava:${retrofitVersion}"
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.5.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
implementation 'com.google.android.material:material:1.0.0-alpha3'
}
I'm tried to run the app on different devices but error always the same.
add android:testOnly="false" and android:debuggable="true" in your manifest section
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:testOnly="false"
android:debuggable="true">
after this clean and Rebuild your project and try to install your apk again.
hope it will work..!! it works for me.
I had changed my LAUNCHER activity to exported=false by mistake. Then removed it and fixed :).
I changed complileSdkVersion to 28 and now it's installs fine.
Build -> Build Bundle (s) / APK (s) -> Build APK (s)
Related
Hello Guys i have make my application first of all for my android mobile but this when i install on my android tv so i am getting an error and it's not working on my android tv but this app perfectly working fine on my mobile how can i run my app on android tv any suggestion please guys help me \
my tv android version is 4.4.2 and my mobile android version is 9
Thanks.
here is manifest of my app
<?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.oxoo.spagreen"
tools:ignore="MissingLeanbackLauncher">
<uses-feature
android:name="android.software.leanback"
android:required="true" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<application
android:name=".utils.MyAppClass"
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"
android:usesCleartextTraffic="true"
android:screenOrientation="landscape"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".WebViewActivity"
android:screenOrientation="landscape"
android:theme="#style/FullscreenTheme"></activity>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-8804184340526788~7833821786" />
<meta-data
android:name="com.onesignal.NotificationOpened.DEFAULT"
android:value="DISABLE" />
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider" />
<activity
android:name=".TermsActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".ReplyActivity"
android:label="#string/title_activity_reply"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".ProfileActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".PassResetActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".SearchActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".SignUpActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".LoginActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".DetailsActivity"
android:configChanges="screenLayout|screenSize|orientation"
android:label="#string/title_activity_details"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" /> <!-- android:configChanges="screenLayout|screenSize|orientation" -->
<activity
android:name=".MainActivity"
android:theme="#style/AppTheme.Nobar"
android:screenOrientation="landscape"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".SettingsActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".SplashscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="landscape"
android:theme="#style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ItemMovieActivity"
android:label="#string/title_activity_item_show"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" />
<activity
android:name=".ItemTVActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
<activity
android:name=".ItemSeriesActivity"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.Nobar" />
</application>
</manifest>
and here is the build.gradle of my app
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.oxoo.spagreen"
minSdkVersion 14
targetSdkVersion 28
versionCode 13
versionName "1.1.3"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [
onesignal_app_id: 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-beta01'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-beta01'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'com.facebook.shimmer:shimmer:0.4.0'
implementation 'com.balysv:material-ripple:1.0.2' // ripple effect
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.volley:volley:1.1.1'
// retrofit
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.google.android:flexbox:0.3.2'
implementation 'com.onesignal:OneSignal:3.10.5'
implementation 'com.hootsuite.android:nachos:1.1.1'
implementation 'com.mikhaellopez:circularimageview:3.2.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'com.google.android.exoplayer:exoplayer-core:2.7.3'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.7.3'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.7.3'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.7.3'
implementation 'com.google.android.exoplayer:extension-rtmp:2.7.3'
implementation 'com.google.android.exoplayer:extension-cast:2.7.3'
implementation 'com.github.HaarigerHarald:android-youtubeExtractor:master-SNAPSHOT'
implementation 'com.google.android.libraries.cast.companionlibrary:ccl:2.8.4'
implementation 'com.github.ixiDev:GDPRChecker:v0.2'
implementation 'com.google.android.ads.consent:consent-library:1.0.7'
}
for an Android TV app you should first provide a dedicated banner so the app icon can be shown in the Android TV launcher. See: https://developer.android.com/training/tv/start/start.html#banner
Also, I don't see any intent-filter for Leanback:
<activity
android:name=".SplashscreenActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:screenOrientation="landscape"
android:theme="#style/FullscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
It possible that you need to create two separate intent-filter (one for mobile and another one for TV).
Pay attention that the navigation between a mobile (touchscreen) and a TV (using a controller) might impact the user experience, even if the app is working well doesn't mean that it's fully compatible with TV experience. Please take a look at this documentation for more information: https://developer.android.com/training/tv/
I developed an app and delete Junit tests implementation from my gradle file to remove the tests package. I'm not sure if was after that, but since, android studio doesn't install one, but four times my app, all are the same.
This is my AndroidManifest.xml
<?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="braziliancard.veraodedescontos_lojista">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:theme="#style/AppTheme"
android:allowBackup="true"
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
<activity android:name=".SplashScreenActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity" android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LoginLojista" android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".utils.ToolbarCaptureActivity" android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
This is a screenshot of what is happening:
this is my gradle.file (app) file:
buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.4.0'
}
}
apply plugin: 'com.android.application'
android {
//compileSdkVersion project.androidTargetSdk
compileSdkVersion 26
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
def validConfig
def keystoreFile
def keystorePassword
def keystoreAlias
try {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
keystoreFile = properties.getProperty('keystore.file')
keystorePassword = properties.getProperty('keystore.password')
keystoreAlias = properties.getProperty('keystore.alias')
validConfig = keystoreFile != null && keystorePassword != null && keystoreAlias != null;
} catch (error) {
validConfig = false
}
if (validConfig) {
System.out.println("Release signing configured with " + keystoreFile)
signingConfigs {
release {
storeFile project.rootProject.file(keystoreFile)
storePassword keystorePassword
keyAlias keystoreAlias
keyPassword keystorePassword
}
}
} else {
System.out.println("Specify keystore.file, keystore.alias and keystore.password in local.properties to enable release signing.")
}
buildTypes {
release {
if (validConfig) {
signingConfig signingConfigs.release
}
debug {
debuggable true
}
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26'
implementation 'com.android.support:preference-v14:26+'
implementation 'com.android.support:support-v13:26+'
implementation 'com.burgstaller:okhttp-digest:1.17'
implementation 'net.sourceforge.jtds:jtds:1.3.1'
implementation 'com.sunmi:sunmiui:latest.release'
// implementation 'javax.mail:1.4.7'
implementation 'com.android.support:appcompat-v7:26+'
implementation 'com.android.support:design:26+'
implementation 'com.android.support:recyclerview-v7:26+'
implementation 'com.sun.mail:android-mail:1.6.2'
implementation 'com.sun.mail:android-activation:1.6.2'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5'
// releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
implementation files('/lib/commons-email-1.5.jar')
implementation project(':zxing-android-embedded')
implementation files('/lib/additionnal.jar')
}
I copied the java folder, the layouts, and the AndroidManifest into another app who was working fine, but the android studio still install more than one time the app.
i guess is something about android manifest or gradle, but i have no idea of what. some tips?
You have the same number of shortcut as your number of launcher activities.
In most of the case, only one is needed
<?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="braziliancard.veraodedescontos_lojista">
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:theme="#style/AppTheme"
android:allowBackup="true"
android:debuggable="true"
tools:ignore="HardcodedDebugMode">
<activity android:name=".SplashScreenActivity"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".MainActivity" android:theme="#style/AppTheme.NoActionBar"/>
<activity android:name=".LoginLojista" android:theme="#style/AppTheme.NoActionBar"/>
<activity android:name=".utils.ToolbarCaptureActivity" android:theme="#style/AppTheme.NoActionBar"/>
<meta-data
android:name="preloaded_fonts"
android:resource="#array/preloaded_fonts" />
</application>
</manifest>
First of all I know there are many similar question, but my case is different. Please read the full question first!
This is the full error...
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/appindexing/Action$Builder$StatusType.class
Whenever I am trying to run in my emulator this error is showing.
Also if I try to generate .apk file (in debug or released mode), the same error is showing.
Now the magic...
If I run in my mobile phone in debug mode, it is totally ok. No errors are showing, it is running fine.
This is my manifest file...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.brandtechnosolutions.petbaazar">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/iconpetbazar"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.Light">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/facebook_app_id" />
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--
ATTENTION: This was auto-generated to add Google Play services to your project for
App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information.
-->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<activity
android:name=".LoginActivity"
android:label="#string/title_activity_login"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".WebActivity" />
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name"
android:screenOrientation="portrait" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true"
android:screenOrientation="portrait">
<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="#string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
<activity
android:name=".BuyerSellerActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".OptionActivity"
android:label="#string/title_activity_option"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity
android:name=".TakeAdInfoActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
</application>
</manifest>
My build.gradle...
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
dexOptions {
javaMaxHeapSize "1g"
}
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.brandtechnosolutions.petbaazar"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// apply plugin: 'com.google.gms.google-services'
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.android.support:support-v4:25.1.0'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'junit:junit:4.12'
}
Using sdk platforms...
Gingerbread, Honeycomb, Marshmallow
Using emulator with Jelly Bean.
Anybody has any idea how to solve it, please help!
You should use the same level of libraries:
compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.android.gms:play-services-appindexing:10.0.1'
Also add at the buttom of the file:
apply plugin: 'com.google.gms.google-services'
EDIT:
To use the plugin you have to add the dependency in the buildscript block (in your top-level file or module file):
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
// ...
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sam.gymnotes" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/NoActionBar" >
<meta-data
android:name="com.google.android.gms.version"
/>
<activity
android:name=".activity_ExcersiseView"
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=".dialog_new_excersise"
android:label="dialog_new_excersise"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".activity_IconChooser"
android:label="#string/title_activity_icon_chooser" >
</activity>
<activity
android:name=".activity_WorkoutView"
android:label="#string/title_activity_activity__workout_view" >
</activity>
<activity
android:name=".dialog_are_you_sure"
android:label="#string/title_activity_dialog_are_you_sure"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".activity_SetView"
android:label="#string/title_activity_activity__set_view" >
</activity>
<activity
android:name=".dialog_edit_workout"
android:label="#string/title_activity_dialog_date_picker"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".dialog_new_set"
android:label="#string/title_activity_dialog_new_set"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".dialog_edit_note"
android:label="#string/title_activity_dialog_edit_note"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".dialog_3option"
android:label="#string/title_activity_dialog_convert"
android:theme="#style/Theme_Dialog" >
</activity>
<activity
android:name=".activity_Info"
android:label="#string/title_activity_info" >
</activity>
</application>
</manifest>
The above is my manifest file, I have gone through numerous answers on here for a malformed manifest and I cannot figure out what the issue is. What is causing the 'Error while Installing APK'. All I get when trying to run is
pkg: /data/local/tmp/sam.gymnotes
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
gradle;
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '24.0.0'
defaultConfig {
applicationId "sam.gymnotes"
minSdkVersion 14
targetSdkVersion 24
versionCode 4
versionName "1.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.google.android.gms:play-services:9.2.0'
}
1) Put </manifest> in the end of the file.
2) Use following code for gms version
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
EDIT
try this answer
-> File
-> project structure
-> app
-> dependencies
-> click on +
-> library dependency
-> select play-services (October 2015: com.google.android.gms:play-services:7.8.0)
-> Rebuild
i migrate to eclipse to Android studio and install the latest version of Android studio 1.3 and i am using too many libraries projects and some of jar files. but now when i try to run this project its always show me
Picked up _JAVA_OPTIONS: -Xmx512M
Error:Execution failed for task ':app:preDexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 3
i place there he write hat remove _JAVA_OPTION -Xm512 will remove app in you project but nothing happen. this is is below my gradle.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 22
buildToolsVersion '21.0.1'
defaultConfig {
applicationId "com.iptikarpromotion"
minSdkVersion 9
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile files('libs/google-http-client-1.16.0-rc.jar')
compile files('libs/gson-2.1.jar')
compile files('libs/google-play-services.jar')
compile project(':libraries:ImageSliderLibrary')
compile project(':libraries:CircularImageView')
compile project(':libraries:GalleryViewLibrary')
}
And manifist is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.iptikarpromotion" >
<permission
android:name="com.example.iptikarpromotion.permission.MAPS_RECEIVE"
android:protectionLevel="signature"></permission>
<uses-permission android:name="com.example.androidmapsv2.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application android:name="com.iptikarpromotion.utils.ApplicationData"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:hardwareAccelerated="true"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBVgaZHjJmXd6pQNRISnzzSbEN0B3aJuns"/> <!-- bebug key= AIzaSyBVgaZHjJmXd6pQNRISnzzSbEN0B3aJuns -->
<activity
android:name=".activity.SplashActivity"
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=".activity.LoaderActivity" android:screenOrientation="portrait"> </activity>
<activity android:name=".activity.HomeActivity" android:screenOrientation="portrait"> </activity>
<activity android:name=".activity.DetailActivity" android:screenOrientation="portrait"> </activity>
<activity android:name=".activity.WebviewActivity" android:screenOrientation="portrait"> </activity>
<activity android:name=".activity.MapActivity" android:screenOrientation="portrait"> </activity>
<activity android:name=".activity.GalleryViewActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.MyFavourateActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.MyAdsActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.ContactUsActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.OurServicesActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.QuicklyPickActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.AllCategoriesGridViewActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.AllCategoriesChildActivity" android:screenOrientation="portrait"></activity>
<activity android:name=".activity.PromotionActivity" android:screenOrientation="portrait"></activity>
</application>
</manifest>
This my jar files
gson-2.1.jar
google-play-services.jar
google-http-client-1.16.0-rc.jar
AndroidEasingFunctions-1.0.0.jar.
Thanks
Remove Java_option in Environment Variable of System of Windows. Exit Android Studio and run it again.