New projects in Android Studio Dolphin failes with Duplicate class errors - Android Studio

Hello
I try to create new projects with Android Studio Dophin (2021.3.1) which fails nevertheless with java or kotlin on win and linux systems:
Default gradle version: 7.4
Default android gradle plugin version 7.3.0
Compile SDK Version: 32
Target SDK Version: 32
Min SDK Version: 21
Create a new project with Basic Activity will fail with the folliwing error:
Duplicate class androidx.lifecycle.ViewModelLazy found in modules lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1) and lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1)
Go to the documentation to learn how to Fix dependency resolution errors.
Click to expand...
Click to collapse
Any hints?

Related

[Q] Error while referencing Xposed based library from xposed modules

Hi all.
I have developed few Xposed android modules in Eclipse and they are all were developed in the same worksapce.
During the development i have realized that i have common functionality between the modules and i decided to create a library with the common behavior where all other modules have to import this library to their build path.
The common library is called 'ModulesCommon' and it is using the Xposed API (HookMethod for example) . Additionally some of the modules them-self use the Xposed APIs.
What i have done in Eclipse is to add XposedBridgeApi.jar to the build path of ModulesCommon and to the build path of the modules that use Xposed API.
In the Build path menu of ModulesCommon and the modules i have navigated into the Build path menu to the tab of "Order and Export" and removed the export sign from XposedBridgeApi.jar .
Every thing worked fine but now i am trying to move the project to Android Studio.
I have created a new project and imported ModulesCommon library with one of the modules that uses Xposed API.
The dependencies block of ModulesCommon contains:
PHP:
dependencies {
provided files('lib/XposedBridgeApi.jar')
}
The dependencies block of the module contains:
PHP:
dependencies {
compile 'com.google.android.gms:play-services:6.5.87'
compile project(':modulesCommon' )
}
The module compiles and installed on the device but i keep getting the same error all the time:
PHP:
W/dalvikvm( 1933): Class resolved by unexpected DEX: Lcom/mol/locationreportmodule/GpsModule;(0x41d70e00):0x41a17000 ref [Lde/robv/android/xposed/IXposedHookLoadPackage;] Lde/robv/android/xposed/IXposedHookLoadPackage;(0x41ac9598):0x40006000
W/dalvikvm( 1933): (Lcom/mol/locationmodule/GpsModule; had used a different Lde/robv/android/xposed/IXposedHookLoadPackage; during pre-verification)
I/dalvikvm( 1933): Failed resolving Lcom/pol/locationmodule/GpsModule; interface 4712 'Lde/robv/android/xposed/IXposedHookLoadPackage;'
W/dalvikvm( 1933): Link of class 'Lcom/pol/locationmodule/GpsModule;' failed
Does anybody can help me to solve this dependency problem?
Thank you!

[Q] CLOSED: Configuring Content Roots

How can I configure content roots?
The documentation seems to be out-of-date.
Version: Android Studio 1.0.2
Documentation: https://www.jetbrains.com/idea/help/configuring-content-roots.html
Thanks,
Barry
-----------
Update:
-----------
From IntelliJ Support:
In AS everything is configured in build.gradle and handled by Gradle.
Android Studio is based on IDEA core code, but it is developed by Google.
As far as I've been able to discern, Google hasn't provided any comprehensive documentation for Android Studio yet.
Closing this out.

Rebuild required after changing xml layout files in Android Studio

I am developing in Android Studio.
There is a problem though. When I change the code and I run the app it works fine, But when i change something in the layout it does not change until i do a clean project. e.g. i add a button and run the app, the button does not exist but when i do a clean project it is there...
Even Android studio shows an error when accessing the id of the newly added view...
Please help me solve this problem. Any help would be much appreciated.
Additional information:
-Android Studio version: 1.3.1
-Operating system: windows
-Gradle version: 2.6
I am having multiple directories as my resources with gradle like this:
Code:
sourceSets{
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
res.srcDirs = [
'src/main/res',
'src/main/res/layouts/test',
'src/main/res/layouts/login',
'src/main/res/layouts/main',
'src/main/res/layouts/includes'
]
}
}
When i try to run the project with changed layout it says:
No apk changes detected. Skipping file upload, force stopping package instead.
DEVICE SHELL COMMAND: am force-stop com.my.package
Click to expand...
Click to collapse
saeednt said:
I am developing in Android Studio.
There is a problem though. When I change the code and I run the app it works fine, But when i change something in the layout it does not change until i do a clean project. e.g. i add a button and run the app, the button does not exist but when i do a clean project it is there...
Even Android studio shows an error when accessing the id of the newly added view...
Please help me solve this problem. Any help would be much appreciated.
Additional information:
-Android Studio version: 1.3.1
-Operating system: windows
-Gradle version: 2.6
I am having multiple directories as my resources with gradle like this:
Code:
sourceSets{
main {
manifest.srcFile 'src/main/AndroidManifest.xml'
java.srcDirs = ['src/main/java', '.apt_generated']
aidl.srcDirs = ['src/main/aidl', '.apt_generated']
res.srcDirs = [
'src/main/res',
'src/main/res/layouts/test',
'src/main/res/layouts/login',
'src/main/res/layouts/main',
'src/main/res/layouts/includes'
]
}
}
When i try to run the project with changed layout it says:
Click to expand...
Click to collapse
Look, there are couple of things you should see,
first when you make changes you should save it every time when you make changes in it
go over all the functions you created and make sure they are wire up correctly and they should not get separated when you make changes, App location can be a problem as well, go over from your code couple of times you will find out the issue because its in your hand

Problem with Gradle

Hi, I'm not an android studio expert and I need help.
I downloaded this project from github (it does not allow me to insert the link) and uploaded it to Android Studio, when I tried to create the apk file I get this error:
Error:Android Source Generator: Error: Can't find bundle for base name messages.AndroidJpsBundle, locale it_IT
java.util.MissingResourceException: Can't find bundle for base name messages.AndroidJpsBundle, locale it_IT
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
at org.jetbrains.jps.android.AndroidJpsBundle.getBundle(AndroidJpsBundle.java:22)
at org.jetbrains.jps.android.AndroidJpsBundle.message(AndroidJpsBundle.java:32)
at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.computeModuleDatas(AndroidSourceGeneratingBuilder.java:1276)
at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.doBuild(AndroidSourceGeneratingBuilder.java:130)
at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.build(AndroidSourceGeneratingBuilder.java:114)
at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1314)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:991)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1063)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:954)
at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:787)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:376)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:183)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:308)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:137)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:235)
at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
can someone help me solve the problem?
My version of android studio is 3.2 gradle 4.6
thanks!

Build issue after importing a non gradle (Titanium Android Module) existing project in Android Studio

Build issue after importing a non gradle (Titanium Android Module) existing project in Android Studio which has different folder structure.
I have an existing project based on Titanium framework but want to use it in Android Studio for further development.
Imported existing project into Android Studio “Open an existing project” opening the folder which has AndroidManifest.xml file. Added external Titanium libraries required for the project, few errors got resolved.
Facing build issues :
Cannot resolve symbol “@drawable/appicon”
Class referenced in the manifest com.xxxx.xxxxx was not found in the project or the libraries
Cannot resolve symbol “@string/app_name”
Cannot resolve symbol “@style/Theme.AppCompact”
Cannot resolve symbol “@style/Theme.AppCompact.Translucent”
Cannot resolve symbol “@style/Theme.Titanium”
Please help me out resolving this errors.

Categories

Resources