I want don't using Custom Main Grade Template in Unity - java

Unity Version 2021.3.16f1
Google Admob 7.1.0
I predcit when I renew JDKLink
Issue with Android dependencies detected:
The SDK has resolved to an incompatible version with the Package. This may result in unexpected behaviour, To avoid this, include the mainTemplate,grade file by checking the checkbox Custom Main Grade Template' in Edit 3 Project Settings 3 Player > Publishing Settings.
Would you like to cancel the build?
if don't checking checking the checkbox Custom Main Grade Template ?
doesn't process build... what can i do ?
I don't know what can i do..

Related

I am trying to run the app on my Android 10 device and the following error is shown - minSdk(API 30) > deviceSdk(API 29)

I am trying to run the app on my Android 10 device from the Android Studio and the following error is shown -
10/17 09:16:05: Launching 'app' on Physical Device.
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_OLDER_SDK
List of apks:
[0] 'C:\Users\WELCOME\AndroidStudioProjects\BottomNav2\app\build\outputs\apk\debug\app-debug.apk'
The application's minSdkVersion is newer than the device API level.
Retry
I think I have to change the minSdk value, but in which file and how to do it?
The device you are using has lesser API than minimum required API set by you. So, either you can create another physical device with API 30, or you can create another project with lesser API.
If you wish to change it in the already existing project, you can go to build:gradle(app). There under default config, you will find minSDKVersion, you can change it from there and then sync project with gradle files. You will see the sync button on top right of the editor after making changes.

How can I stop Gradle deleting .jars from my project's module path?

I'm trying to develop a Gradle project which involves JavaFX.
Specs: Linux Mint 18.3, Java 11, Eclipse 2019-06, JavaFX: either 13 or 11...
A couple of useful answers to questions have helped me over the past hours: this one tells me (with useful clonable example) how to configure things, at least using a Java file to hold my project's main class (in fact I ultimately want to write all my code in Groovy ideally), in order to overcome the error "JavaFX runtime components are missing, and are required to run this application".
But Eclipse doesn't like it when you add the final step: the file module-info.java. At this point I have to confess I know nothing whatsoever about Eclipse "modules": only that this unknown aspect of the IDE has occasionally caused me frustrating headaches in the past. Probably time to read up on it now.
I should also clarify that at this point the Gradle tasks build and installdist (or assemble) work fine at the CLI. I am only concerned about getting rid of these horrid Eclipse white-cross-in-red-box error marks:
in module-info.java: "javafx.controls cannot be resolved to a module"
in Main.java: all the JavaFX classes have this next to them "Application [etc.] cannot be resolved to a type", and all the imports have "The type javafx.scene.Scene [etc.] is not accessible"
This answer says to download the JavaFX-JDK and then add various .jars from it to your project's module path. I did that: the horrid errors all disappeared!
Next time I did a Gradle - Refresh they all came back. I checked module path: all these .jar files had been removed. How can I stop the Gradle-Eclipse functionality messing with my configured module path?
edit
re the comment by Slaw: yes, already using
id 'org.openjfx.javafxplugin' version '0.0.8'
... my build.gradle javafx block looks like this:
javafx {
version = "13"
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
(NB I have now tried experimenting by adding 'javafx.graphics' and 'javafx.base' to the above.)
The issue is that Gradle - Refresh nevertheless causes the above "disappearing .jars" phenomenon.
I tried adding this to my plugins block:
id 'org.javamodularity.moduleplugin' version '1.6.0' apply true/false // NB tried both
... no go: Gradle - Refresh leads to an incomprehensible (to me) error:
An exception occurred applying plugin request [id: 'org.openjfx.javafxplugin', version: '0.0.8']
> Failed to apply plugin [id 'org.openjfx.javafxplugin']
> Could not create task ':configJavafxRun'.
> Could not create task of type 'ExecTask'.
> Could not generate a decorated class for class org.openjfx.gradle.tasks.ExecTask.
> org/javamodularity/moduleplugin/tasks/ModuleOptions

Override ids generation (R file) in gradle android plugin (use public.xml)

I want to override ids generation in new (2.2.2) Android Gradle Plugin in order to make constant ids. Ids are located in public.xml file. This is mandatory if I want to create a separate app that extends Theme of my main application. (standalone theme)
Android Gradle Plugin 1.2.3 <= - generates ids for resources in R files, using public.xml file
Android Gradle Plugin >= 1.3.0 ignores public.xml file. https://code.google.com/p/android/issues/detail?id=182046
Is there any way to hack it?

Project Not working after updating to API 23

Can anyone please help me with this? I dont know what does this mean.
To give you a back up I updated my sdk with 23 and then i got 101 errors regarding HTTPClient not being resolved. So i followed this link to remove that then I have this error of which i have no clue where to start with.
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\build-tools\23.0.1\dx.bat --dex --no-optimize --output F:\sagarDevanga\workspace\AndNrby\app\build\intermediates\dex\debug --input-list=F:\sagarDevanga\workspace\AndNrby\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lorg/apache/http/ConnectionClosedException;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
Make sure that your adt supports the version of api that you are running. See this link : https://developer.android.com/tools/support-library/index.html
To fix you should check in libs (.jar) and in your build.gradle if there are some libraries duplicated. This error happen tipicaly when you add a copy of the same library or a library that include a copy of another library that you have already added
Update also your support libs from SDK
Ok I have updated the question's title also so that other people also find it useful.So I will write a detailed answer about how this error occured in my project and the fixes I did and how I finally derived the answer.
1) I updated the SDK and then started to compile my project using the latest api i.e API 23. You can do that by going to File -> Project Structure ->Select your module.
Now in the right hand side window under properties the top two properties can be changed using in the drop down.
Then click on Apply and Ok.
2) So when you do this your app's build.gradle file will look like this. And now everything looks good. It will compile also. But when you run the project you will get a lot of errors by this name Error:(17, 35) error: package org.apache.http.impl.client does not exist Obviously if you are using them in your async tasks.
3) So when i got this error I did a lot of research here and there and then came across this link and added the HTTP CLIENTS jar files in the libs folder and then tried to run the program I ended up with this problem (problem mentioned in the question).
4) So after diggin around I found that the problem was HTTP methods which i used in the Async task were deprecated in the API 23 hence I landed myself in this mess.
5) Then what I did next fixed the problem for me. Refernce given here.
6) In your module's build.gradle file add this line useLibrary 'org.apache.http.legacy' like below.
7) Wait your still not done. Now go to your main build.gradle file and add this line classpath 'com.android.tools.build:gradle:1.3.1' like this . Now build and compile your project everything runs fine.
8) After all this steps the project works fine but I have a doubt in the last pic that i shared which is of the top level build.gradle file. Whether I should keep both the classpaths or just use this classpath 'com.android.tools.build:gradle:1.3.1' and remove the other one. If any one have any idea on this please help.
9) The problem was that they deprecated the HTTP Clients in the Latest Android API 23. Insted of HTTP Client you have to use HttpUrlConnection but if you want to continue using HTTP client for NOW follow the steps above.

Custom Lint Rule not listed in eclipse / android studio

I have created custom android Lint check rule it works well when I run it from command line but Android Studio does not take that rule when checking it with "Inspect Code".I have selected all the Lint Rules in Inspection Profile of android studio.
What I did is
Created JAR with custom lint check rule
Placed the jar into ~/.android/lint
When I run the lint checking from command line it works as it should.
like below output shows it check against the rule.
lint OpenGLLearning
Scanning OpenGLLearning: ...............................
Scanning OpenGLLearning (Phase 2): ....
res/layout/activity_opengl.xml:8: Error: Edit Text ID Must be starting with et [etName]
<EditText
^
Here etName is my Issue ID for custom lint rule which I created.
but Android Studio does not list "etName" rule anywhere and not show error when checked against lint with Inspect Code.
when I run
./gradlew check
it does checks against rule.and custom rule also appears when I run lint --list command on terminal but not able to figure out why it not checked by Inspect Code in Android Studio.
I am using build tools 21.0.2 and Target Version 21
i solved this by adding jar module into project and explicitly specifying lint dependency in app.gradle
lintChecks project(':your_module_name')

Categories

Resources