android-gradle

How to build an Android Gradle based app with NDK only for the ARM target?

那年仲夏 提交于 2019-11-28 10:35:07
I have a .so file from vendor which only support "arm". Currently it works perfectly fine for my Android application. Somehow I want to separate the implementation using Android Studio module, so I can export the module as Jar following this tutorial https://www.youtube.com/watch?v=1i4I-Nph-Cw . When I export the JAR, the build process returns an error /Users/zoom/android-ndk-r9d/toolchains/mipsel-linux-android-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/mipsel-linux-android/4.8/../../../../mipsel-linux-android/bin/ld: skipping incompatible src/main/jniLibs/armeabi/libremote_client.so when

Is there a way to limit method amount in main dex file while using MultiDex feature in Android Studio

ぃ、小莉子 提交于 2019-11-28 10:14:35
When I enabled MultiDex feature in Android Studio like the document says, it automatically spilted into two or more dex files. I cannot config it. And it seems that in the main dex file, the amount of methods is very close to the limitation(65536). The question is how to config it, make the amount of methods in the main dex file reduce to a certain number, say 60k. I have to upload the apk to amazon appstore, and the people of amazon will add a few methods into the main dex file and make it over the 65536 limit. dx tool has the following options: --minimal-main-dex - will put only classes that

Android Studio: Resolving Duplicate Classes

…衆ロ難τιáo~ 提交于 2019-11-28 10:14:35
When I try to run my android application on an Android device, the gradle console reports the following error: Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/loopj/android/http/AsyncHttpClient$1.class When I search for the "AsyncHttpClient" class, I see that it's indeed being found in two separate locations: /Users/Afflatus/.gradle/caches/modules-2/files-2.1/com.loopj.android/android-async-http/1.4.9/5d171c3cd5343e5997f974561abed21442273fd1/android-async-http-1

Android Gradle Plugin 1.1.0 - getNdkFolder() not found anymore, any replacement?

老子叫甜甜 提交于 2019-11-28 10:04:41
I just updated android Gradle plugin to 1.1.0 from 1.0.0, and I got this error: No signature of method: com.android.build.gradle.LibraryPlugin.getNdkFolder() is applicable for argument types: () values: [] I tried to find diff of gradle plugin 1.0.0 to 1.1.0 but couldn't find anywhere online. Seems like getNdkFolder method has been either changed or removed. Is there a replacement ? Or any other way to get NdkFolder ? I'm using that method like this, def ndkDir = project.plugins.findPlugin ( 'com.android.library' ).getNdkFolder () I have also filed an issue against tools team in Android issue

Dagger 2 generated test component not recognized

浪子不回头ぞ 提交于 2019-11-28 10:03:27
I'm hoping that this is just something I'm doing wrong here. I'm trying to use Dagger 2.0 to inject dependencies for my JUnit tests ( not Espresso tests , just pure JUnit). So, I have a 'main' java module and a 'test' java module. In the main module, I've got a Dagger Module and a Component: @Module public class MainModule { @Provides public Widget provideWidget() { return new ConcreteWidget(); } } ... @Component (modules = MainModule.class) public interface MainComponent { void inject(WidgetConsumer consumer); } And in my test module, I have the following: @Module public class TestModule {

Android Studio Gradle error “Multiple dex files define…”

半腔热情 提交于 2019-11-28 10:02:11
My Project was working fine, when I have added facebook sdk into my project I have an error like this, I have tried so many ways to fix this, but I didn't. What should I do? Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: bolts/AggregateException.class My App gradle is below apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion '21.1.2' defaultConfig { applicationId "com.example.myproject" minSdkVersion 9 targetSdkVersion 21 versionCode 1 versionName "1.0" multiDexEnabled = true }

How can I add a JAR in my gradle project?

与世无争的帅哥 提交于 2019-11-28 10:01:00
I am using gradle in Android studio for an android project. I have a jar that I downloaded called TestFlightAppLib.jar . This jar isn't present in the maven repository so I can't just put it in my build.gradle . How can I add this JAR file to my project? I don't see any option to add an external jar to the project. Update This is my complete build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' repositories { mavenCentral() } android { compileSdkVersion 18 buildToolsVersion "18.1.1" defaultConfig {

This support library should not use a different version, error in build.gradle

拜拜、爱过 提交于 2019-11-28 09:50:21
There is one problem in my build.gradle . The error in the gradle is that ( compile 'com.android.support:appcompat-v7:24.0.0-beta1' ) on this line the error display that (This support library should not use a different version(24 ) then the compile sdk version 23) Any idea? And I used Android Studio 2.1.2 and the main problem is that in Android studio there is no android support library. pic is below Your compileSdkVersion is 23 in the build.gradle file but you're trying to use appcompat-v7:24.0.0 which is for API 24, so you should use appcompat-v7:23.x.y for API 23. If you still want to use

Pulltorefresh add to gradle

余生颓废 提交于 2019-11-28 09:30:27
can anyone help me add this library in build.gradle Android Studio. https://github.com/chrisbanes/Android-PullToRefresh I know it is deprecated but I want to use it, I would appreciate if someone could help me what to write in dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'com.android.support:appcompat-v7:+' compile '????' } as mentioned I want to use the deprecated library not new Actionbar-Pulltorefresh. tried to google it but couldn't find any help. I suggest you to use ActionBarPullToRefresh (same author). However, if you would like to use PullToRefresh, you have

What is dex in Gradle

风格不统一 提交于 2019-11-28 09:16:47
What is the dex in Gradle or in Android? In Gradle, what's the meaning of dexoptions ? Sometimes my project does not compile because of some dexerrors. I need to activate ProGuard to compile my Android app. In the standard java world: When you compile standard java code : the compiler produce *.class file. A *class file contains standard java bytecode that can be executed on a standard JVM. In the Android world: It is different. You use the java language to write your code, but the compiler don't produce *.class files, it produce *.dex file. A *.dex file contains bytecode that can be executed