installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error) - android-studio

I am unable to run app from android studio to my samsumg phone running android 2.3.6. I am getting Application installation Failed popup refer below screenshot.
when I click on OK I get below error in log
Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall my.package.name
Unknown failure
I got in this trouble after adding Google Cloud Module called "App Engine Backend with Google Cloud Messaging".
This is exactly same problem described in one of stack overflow questions here
I tried the accepted answer.
Ran dex-method-counts application I got "Overall method count: 24474" in terminal. I dont understand what to do next?
(Note : The same application is running on my other device running on kitkat.)
Please help to resolve this issue. I am struggling from past two days. I know there are many similar questions but nothing helped me.
Built--> Clean is not working.
Here is my build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "my.package.name"
minSdkVersion 9
targetSdkVersion 19
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile files('libs/libGoogleAnalyticsServices.jar')
compile project(path: ':gcmAppEngineBackend', configuration: 'android-endpoints')
compile 'com.android.support:support-v4:22.0.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services:7.0.0'
}
Thanks in advance!

This usually happens because your device doesn't have enough space in memory.
Delete some apps and try again

When i got this error, i was using a Nexus 4 in the AVD-Manager. By default this device was created with 500MB internal storage.
I increased the storage to 2048MB and the "stale dexed" error was gone.
To increase the internal Storage:
Go to ADV-Manager
Select the Edit Button of the corresponding device under "Actions"
Click "Show Advanced Settings"
Increase your internal Storage

In case it's an Android Emulator giving you a "stale dexed" message, this helped for me on a Mac:
stop emulator
cd ~/.android/avd/[emulator name].avd
rm *.lock
wipe emulator
start emulator

I solved this by Wiping data .
Android Studio -> AVD Manager -> Actions -> Wipe Data

It seems like your emulator low on disk space. But after you increase your disk space you still get error.
I faced the same problem, increase disk space and do factory reset for the emulator worked as well for me. To reset your emulator go to Settings -> Backup and Restore inside the emulator then reset.

Disable Instant Run.
Android Studio -> Preferences -> Instant Run

Also I have the same problem. To make it work I had to remove "third party library" from dependencies.
Or try this: https://developer.android.com/tools/building/multidex.html

Replace this 'compile files('libs/libGoogleAnalyticsServices.jar')' with this 'com.google.android.gms:play-services-analytics:8.3.0'

Related

How to configure plugin verifier as it runs during JetBrains Marketplace admission?

Can you advise how to configure the plugin verifier so it would return errors as JetBrains marketplace does, please?
Error from the marketplace:
[plugin] depends on plugin com.jetbrains.php that couldn't be resolved with respect to IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4)
Note that the [plugin] cannot be installed into IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4) without mandatory com.jetbrains.php
Found 1 incompatibility with IntelliJ IDEA Ultimate IU-202.8194.7 (2020.2.4), some of which may be caused by the missing dependencies.
When running runPluginVerifier locally everything is fine:
2020-12-11T13:01:29 [main] INFO verification - Finished 1 of 2 verifications (in 3.1 s): IU-202.8194.7 against com.lokalise.jetbrainsideplugin:1.0.0-alpha: Compatible
2020-12-11T13:01:30 [main] INFO verification - Finished 2 of 2 verifications (in 3.6 s): PS-202.6948.87 against com.lokalise.jetbrainsideplugin:1.0.0-alpha: Compatible
I would like to catch such an error during CI at most instead of throwing the plugin at the marketplace team.
Here is the gradle task configuration (Kotlin):
import org.jetbrains.intellij.tasks.RunPluginVerifierTask
...
tasks.runPluginVerifier {
ideVersions("PS-202.6948.87,IU-202.8194.7")
setFailureLevel(RunPluginVerifierTask.FailureLevel.ALL)
}
I struggled with it quite a bit. Found it.
tasks {
runPluginVerifier {
ideVersions.set(listOf("PS-202.6948.87","IU-202.8194.7"))
}
...
}

Create New Folder in Android Studio is empty (nothing here)

Resume:
Normally in Android Studio when you right click on a SRC directory, the menu NEW> FOLDER> have many options like: AIDLS Folder, Assets, INI, JAVA, etc:
New>Folder>Option example
My is empty (see last image bellow).
Theory:
I have created two product flavors in my in my Build.Gradle:
flavorDimensions "version"
productFlavors {
free {
applicationId "com.xxxx.yyyy.free"
versionName "1.0-free"
buildConfigField "boolean", "PAID_VERSION", "false"
dimension "version"
applicationIdSuffix ".free"
versionNameSuffix "-free"
}
full {
applicationId "com.xxxx.yyyy.paid"
versionName "1.0-full"
buildConfigField "boolean", "PAID_VERSION", "true"
dimension "version"
applicationIdSuffix ".full"
versionNameSuffix "-full"
}
}
When you create a new product flavor, Android Studio doesn't create the source set directories for you, but it does give you a few options to help you. For example, to create just the java/ directory for your "debug" or "release" build:
Open the Project pane and select the Project view from the drop-down menu at the top of the pane.
Navigate to MyProject/app/src/.
Right-click the src directory and select New > Folder > Java Folder.
From the drop-down menu next to Target Source Set, select debug or release.
Click Finish.Android Studio creates a source set directory for your debug build type, and then creates the java/ directory inside it.
(Ref. https://developer.android.com/studio/build/build-variants?utm_source=android-studio#product-flavors)
Problem:
As you can see in the following image, my Folder options is empty. Can anybody explain me why?
Solved: The folder options came back after restarting Android Studio and Rebuild the Project. Can’t simulate back the case and the real reason it’s unknown to me or it’s an Android Studio 3.2.1 bug.

Android Studio transformClassesWithMultidexlistForDebug RemObjects library

After added one more library to project and enabled multiDex, Android studio is started showing this error:
Error:java.lang.RuntimeException: java.io.IOException: Can't read [MyApp\libs\com.remobjects.sdk.jar(;;;;;;**.class)] (Can't process class [com/remobjects/sdk/helpers/Logger.class] (Method must be overridden in [proguard.classfile.attribute.SourceFileAttribute] if ever called))
Error:java.io.IOException: Can't read [MyApp\libs\com.remobjects.sdk.jar(;;;;;;**.class)] (Can't process class [com/remobjects/sdk/helpers/Logger.class] (Method must be overridden in [proguard.classfile.attribute.SourceFileAttribute] if ever called))
Error:java.io.IOException: Can't process class [com/remobjects/sdk/helpers/Logger.class] (Method must be overridden in [proguard.classfile.attribute.SourceFileAttribute] if ever called)
Error:java.lang.UnsupportedOperationException: Method must be overridden in [proguard.classfile.attribute.SourceFileAttribute] if ever called
gradle console:
:MyApp:transformClassesWithDexBuilderForDebug
:MyApp:transformClassesWithMultidexlistForDebug FAILED
build.gradle:
defaultConfig {
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.config
}
debug {
minifyEnabled false
signingConfig signingConfigs.config
}
}
buildscript:
classpath 'com.android.tools.build:gradle:3.0.1'
I'm working on three applications and only this one is problematic. One app is only upgraded version of other and upgraded app generating apk file sucessfully. I tried to copy gradle file and edit it, but without any luck.
I already tried editing proguard.cfg with all possible commands I found on internet but error is still there.
Tomorrow I have to publish new verison and I can't build APK..
I found what was wrong.
Minimal SDK version in Manifest was set to 15 and after I changed it to 21, APK was successfully generated.

Android Studio 2.3.3 stuck on Gradle Build Running

Using android studio 2.3.3 I've stuck on Gradle Build Running.
I don't have any idea and loss my mind to figure it out what happened with my project. Recently we want to compile Zoom Login Application Sample and following carefully from this link.
Here are Android Studio Version :
Android Studio 2.3.3
Build #AI-162.4069837, built on June 6, 2017
JRE: 1.8.0_31-b13 x86
JVM: Java HotSpot(TM) Server VM by Oracle Corporation
On event log, Grade seems working hard to finish this task
Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
I've tried to
Set Global Gradle Setting to Offline Work by followed this solution
Isn't using google play service like this solution suggest.
Not using proxy
Add org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 and org.gradle.parallel=true on gradle.properties project
On C:\Users\<username>\.gradle\gradle.properties add this line org.gradle.daemon=true and org.gradle.parallel=true
Every solution I tried but no one work well. This is silly and ridiculous, the build phase cannot be completed even I leave that for one night.
Here is project build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.facialnetwork.com/maven2'
credentials {
username '***'
password '***'
}
authentication {
basic(BasicAuthentication)
}
}
// Reference local .aar file if it doesn't exist in maven
flatDir{ dirs '../../../' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and here module build.gradle
buildscript {
}
apply plugin: 'com.android.application'
android {
if (project.hasProperty("zoom_keystore")) {
signingConfigs {
release {
storeFile file(zoom_keystore)
storePassword zoom_keystore_password
keyAlias zoom_key_alias
keyPassword zoom_key_password
}
}
}
compileSdkVersion 25
buildToolsVersion '25.0.3'
defaultConfig {
applicationId "com.facetec.zoom.sampleapp"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
buildConfigField("String", "ZOOM_APP_TOKEN", System.getProperty("zoom_app_token", "\"\""))
resConfigs "en"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (signingConfigs.hasProperty('release')) {
signingConfig signingConfigs.release
}
}
debug {
debuggable true
jniDebuggable true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support:appcompat-v7:25.+'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.facetec:zoom-authentication:5.1.1#aar'
compile project(':zoom-authentication-5.1.1')
}
after trying to build from gradlew command line gradlew -d assembleDebug,
I got this log, maybe can help identify my problem :
09:08:19.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock
acquired.
09:08:19.942 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Relea
sing lock on daemon addresses registry.
> Building 62% > :app:compileDebugJavaWithJavac
Its stuck on task :app:compileDebugJavaWithJavac
I've tried to delete caches on C:\Users\<username>\.gradle\caches and still hang on :app:compileDebugJavaWithJavac process
I cannot figure it out. Any Idea? What I miss out?
Thanks.
This works for me:
CTRL + SHIFT + ESC -> Process -> Kill java.exe -> Rebuild
I also face this problem.
and i m really tired because i continuously 3 days find this solution.
then i show in gradle console. in which it show error: C:\Users\khimsuriya\AppData\Local\Android\sdk\build-tools\29.0.3-> "aapt" does not start.
so i change "build tool version" to 26.0.3 and the error was finished.
so you try change "build tool version" in your build.gradle(app level). it continue still you find perfect "strong textbuild tool version"
it is 100% work.
My number .9725414329

unable to run locally orchard azure project ysod fresh off sources

I am trying to run locally Orchard.Azure.CloudService project without any code changes to the official stable release 1.7.1 (58c21815). full source address is # https://git01.codeplex.com/orchard .
Here is the steps to reproduce the error:
launch the Orchard.Azure solution
select "Debug" build
click on press F5 start debugging
the page will show "Server Error in '/' Application."
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'Orchard.Environment.DefaultOrchardShell' can be invoked with the available services and parameters: Cannot resolve parameter 'Orchard.Mvc.Routes.IRoutePublisher routePublisher' of constructor 'Void .ctor(System.Func1[Autofac.Features.OwnedInstances.Owned1[Orchard.Environment.IOrchardShellEvents]], System.Collections.Generic.IEnumerable1[Orchard.Mvc.Routes.IRouteProvider], System.Collections.Generic.IEnumerable1[Orchard.WebApi.Routes.IHttpRouteProvider], Orchard.Mvc.Routes.IRoutePublisher, System.Collections.Generic.IEnumerable`1[Orchard.Mvc.ModelBinders.IModelBinderProvider], Orchard.Mvc.ModelBinders.IModelBinderPublisher, Orchard.Tasks.ISweepGenerator)'.
Source Error:
Line 111: var shellScope = _shellContainerFactory.CreateContainer(settings, blueprint);
Line 112:
Line 113: return new ShellContext {
Line 114: Settings = settings,
Line 115: Descriptor = descriptor,
Source File: c:\projects\orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs Line: 113
`
... "
Windows 8, x64
VS2012.3 Azure SDK 2.1
source code version hash: 58c21815
It is a known issue that the solution can't run in the emulator. This is caused by the structure of the solution, and the fact the emulator doesn't run the cspack file. This script is used to copy modules and themes into the package for Azure deployment. When the emulator runs it simply mounts the Orchard.Azure.Web project which is almost empty and doesn't have all the files necessary to run the solution.
See this discussion on CodePlex for more detail.
I don't believe you should be running that solution but the main Orchard solution.
ie, you don't need to develop specifically for Azure, just deploy for Azure.
I think ^_^

Resources