i am using android studio to create simple image slider project and i am using this library. but when i want to see dependencies tree i got 100 error. i have searched a lot bot does not see such even problem.
here is build gradle :
here is errors:
and i have installed support library repository:
this is not an error you are running the application as gradle androidDependencies and it's showing you the used dependencies change it from the run menu and select app
Related
Recently I merged some changes from a colleague and these changes have React Native Navigation setup in it. After installing all the dependencies and setting up everything, When I run the app, I get this error that says
com.app.MainActivity cannot be cast to com.reactnativenavigation.NavigationActivity
Apparently, the error is coming from the following file
react-native-navigation\lib\android\app\src\main\java\com\reactnativenavigation\react\NavigationModule.java
How to reproduce
I am not really sure how to reproduce this error because I don't know what's causing it in the first place. However, the only other unexpected behavior was that my Android Studio or react-native run-android both were failing gradle build when I first added all the required dependencies. The reason for failure was kotlin-android and even though I can confirm that from the build.gradle files of the repository that the required settings exist, still I had to add the relevant required config to my main applications android/gradle.build and android/app/gradle.build
Apparently this solved the issue with now react-native run-android running successful gradle build.
The repository has the following dependencies config
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
Despite the presence of above, my gradle builds were failing and complaining about android-kotlin so I added the following dependencies config to my app's android/gradle.build
classpath('com.android.tools.build:gradle:3.6.2')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
Notice the difference in versions of the gradle (This gradle version came by default with RN 0.62) and kotlin-gradle-plugin. I don't know, but could this be the cause of the issue?
I am using latest version 5.5.1 for #react-navigation/native
I finally figured this out. Actually the problem was being caused by another package that was just added to the project and wasn't setup and being used. The package that was causing the issue was https://github.com/wix/react-native-navigation which I didn't notice it was there and it apparently wasn't properly configured.
I have a project using dynamic feature module, and I want to run my unit test in feature module via gradle task (for my CI purpose):
./gradlew :feature_product:test
But it always gives me NoClassDefFoundError for tests that have dependencies on classes from the base module:
com.example.android.feature.product.ProductViewTest > on vote change to negative FAILED
java.lang.NoClassDefFoundError: app.BaseView
ProductView class from the feature module extends BaseView from the base module.
Oddly, it succeeds when run in Android Studio, it works fine.
Then I notice something different in the logs, when I run via command line and when I run Android Studio. The first line in the Android Studio is generateDebugSources, something which absent when I run ./gradlew test
Executing tasks: [:lib_ui:generateDebugSources, ...]
How do I fix this? Does Android Studio has different command with the provided command ./gradlew test when I press Ctrl+Shift+R ?
After searching further about this issue, I found it also being reported in the android-test and app-bundle-samples projects and there is also an issue in the issue tracker.
It turns out this issue fixed in the Android Gradle Plugin 4.1.0 as per comment in the issue tracker.
If you don't want to update AGP to 4.1.0 which is still in alpha, adding this to the feature module's build.gradle fixed the issue for me, as per this comment:
testRuntimeOnly(files("$projectDir/../b_app/build/intermediates/app_classes/debug/classes.jar"))
If it is a missing task that you believe is necessary then calling it first like below should do the trick:
./gradlew :lib_ui:generateDebugSources :feature_product:test
I would even go full on and assemble the dependencies if necessary though that might take more time:
./gradlew :lib_ui:assemble :feature_product:assemble :feature_product:test
I want add a library to my project in Android Studio, but it gave me this error no matter what my library is. I always get this error when I want to add a library:
Error:(24, 13) Failed to resolve: com.squareup.retrofit2:retrofit:2.1.0
Do I have to sync the project in online mode to add a library? I sync project online work but sync never be ended.
You need to enable online mode so gradle can download the JAR and put it into the gradle dependencies directory. Optionally (which I dont recommend) you can download it manually and put it there.
However once you downloaded a particular dependency you gradle will synch it from the local repo, meaning you dont need internet to add it to another project.
I've included some dependencies to my gradle , they all works very well but it's been 3 days that one of these dependencies is not working anymore and I get error when gradle project sync is in progress and after a while I get this error :
Error:(29, 13) Failed to resolve: com.koushikdutta.ion:ion:2.+
Show in File<br>Show in Project Structure dialog
I don't use any proxies, I reset android studio settings , I've tried some other projects and all of them has the same error .
the question is , How can I use this library without using dependencies ?
this is the library website :
https://github.com/koush/ion
how can I do so ?
Because this comment served me as an answer after so many painful hours, thanks to A-n-v-e-s-h:
Just add dependency compile 'com.koushikdutta.ion:ion:2.1.6' in ur app gradle file. It will work.
Though, it might seem like specifying any specific version would, I did try with 2.1.7 before, it failed - could be a failure to resolve that. But the 2.1.6 above did work for me as well. Thanks to the original poster...
Maybe this will help you: in Android Studio, click File -> New -> Import new module -> browse to the dependencies location.
I am trying to import an unity3d project to my android project as a module. All is okay, gradle sync finish without error, but when i add unity project as dependency to my project and run gradle sync then it says:
Error:Dependency myapplication:unityproject:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: /Users/michal/Documents/Projects/myapplication/unityproject/build/outputs/apk/unityproject-release-unsigned.apk
I tried google it, but with no luck... Thanks a lot for any tips...
I am using Android Studio (if it helps)
I can build and run standalone unity3d project on mobile device, problem is only when i am trying to add it as module (dependency) to another project
In your library's gradle.build, Change the line apply plugin: com.android.application to apply plugin: com.android.library and remove the setApplicationId
In Android Studio, you can't depend on an Android Application module (which has an APK as its output). You can only depend on Java libraries (which compile to JAR) or Android Library modules (which compile to AAR).
I'm an android noob, but I was able to import a simple Unity app into Android Studio by checking "Google Android Project" in the export dialog.
Deets:
* Unity 4.6.1
* Android Studio 1.0
(note if you download A.S. "1.0", you still need to do a software update a couple times to really get it)