Android things connected with eth0 and Wlan0 but fail to install apk - raspberry-pi3

I am trying to install apk first time on Raspberry Pi 3 board which have installed flashed .zip downloaded from android things console with empty bundle.
Now i am able to connect my device using wifi IP address assign to board .
So i connect it like :
adb connect 10.xxx.x.xxx:5555
connected to 10.xxx.x.xxx:5555
Now i am trying to install apk:
adb install D:\Project\xxx\xxx\app\build\outputs\
things_V01.apk
Failed to install D:\Project\xxx\xxx\app\build\outputs\
things_V01.apk
What could be issue here.
Below is my gradle of app .
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "xx.xxxx.xxxx"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
provided 'com.google.android.things:androidthings:0.4.1-devpreview'
testCompile 'junit:junit:4.12'
}
Also noted that after adb install command it take much time for apk size withing 1.50MB apk .

As a sanity check, have you tried to interact with the device using another adb command such as **adb **?

Related

All com.android.support libraries must use the exact same version specification even after versions are same

This is all my gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.1'
defaultConfig {
applicationId "com.example.remindme"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:28.+'
compile 'com.android.support:recyclerview-v7:28.+'
compile 'com.getbase:floatingactionbutton:1.9.0'
compile 'com.wdullaer:materialdatetimepicker:1.2.1'
compile 'com.bignerdranch.android:recyclerview-multiselect:+'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
}
but it still is giving me error on this line
compile 'com.android.support:appcompat-v7:28.+'
I dont know whats wrong now any tips how to solve the issue now
You are using SDK version of 28 and please build your SDK version from 28.
Steps:
Close the current project.
Click on "Looking for updates".
Start update.
After the completion of your updates, go to setting and set your gradle offline and keep remember that your gradle should also be updated.
Thank you and I hope that will be helpful to you.

Gradle DSL method not found when updating application version

I want to update my app on google play store, it can't accept the updated file with the same version.
Do I've changed the version from build.gradle file :
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "net.koorasudan.app"
minSdkVersion 14
targetSdkVersion 21
versionCode 5.1
versionName "5.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
But when I sync the gradle it shows me this error :
Error:(23, 0) Gradle DSL method not found: 'versionCode()'
Possible causes:The project 'SmartView 3' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin
How to solve this problem?
The versionCode is an integer.
You can't use versionCode 5.1 in your build.gradle
Also you have to add this line at the beginning of your script.
apply plugin: 'com.android.application'
Did you add the android plugin on top of the gradle file?
apply plugin: 'android'
Version code needs to be an integer by the way! switch from 5.1 to 5 and it will work!
FWIW: I have encountered this problem when testing for large version codes (>= 10 digits). Gradle bug?
You should put your version code as Integer. after any publication of your app you have to increase version code so that the android OS finds out that this version is newer one.
but in Version name you can put what ever you want in string format.
hope usefull
Version code should be in integer format.
Please use the code below:
<i>
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "net.koorasudan.app"
minSdkVersion 14
targetSdkVersion 21
versionCode 5
versionName "5.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
</i>
just use version code 2, do not use version code 2.0 or any float value
versionCode 2
versionName "2.0"
like this and rebuild the app, it will solve your problem

Tango sample apps on Android Studio, with Gradle

Does anyone know a way to import the Java Tango samples (https://github.com/googlesamples/tango-examples-java) in Android Studio, and configuring correctly the build with Gradle ?
I've been able to import them in Android Studio, via "Import Project...", compile them and install them on the Tango tablet, but without using Gradle.
Any ideas ?
There is a git project which already migrates the samples to Android Studio - https://github.com/briangriffey/tango-examples-java
I think what you are asking for is the correct setup to let Gradle work for you.
For this you need to create a build.gradle file in your app's directory if the import did not do it for you. The build.gradle should look like this:
apply plugin: 'com.android.project'
android {
compileSdkVersion 16
buildToolsVersion "19.1.0"
defaultConfig {
minSdkVersion 17
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile files('libs/MyJar.jar')
}
With the corresponding values for SdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion.
In the "dependencies" block you can list all your jar-dependencies with :
compile files('libs/thejar.jar') or compile fileTree(dir: 'libs', include: ['*.jar']) if you have multiple jars.
Secondly, if it was not automatically created, you would need two files settings.gradle and build.gradle a the top-level of your project.
settings.gradle should contain:
include ':app'
assuming your app name is 'app'.
and build.gradle should contain:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Once you have this all in your project, you can use Build>Rebuild Project to make Gradle build the project for you.
Just as a follow up here, Tango c examples has been migrated to Android Studio project, you should be able to import directly to Android Studio now.

Gradle 'Build Script error' occurs when I attempt to use testCompile in dependencies

I'm working with Android Studio and in my dependencies for my application I attempting to add a testCompile dependency as listed here: http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
When I sync my file I get the error:
I don't understand what is going on, my gradle build file in my root folder is set to classpath 'com.android.tools.build:gradle:0.12.+' and that's the most recent version. Why doesn't it recognize testCompile? I don't want to deploy test dependencies to production... Any helps would be appreciated.
EDIT: Here is the project build file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
and here is the src build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.edu.myApp"
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/scribe-1.3.5.jar')
compile files('libs/json_simple-1.1.jar')
compile 'com.google.android.gms:play-services:5.0.77'
// Can't be higher than 19 if we want to support smaller android versions
compile 'com.android.support:appcompat-v7:19.+'
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v4:19.+'
// This Mockito includes all dependancies (great for us)
testCompile "org.mockito:mockito-core:1.9.+"
testCompile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.objenesis:objenesis:1.2'
}
You should use androidTestCompile, not testCompile. If this is due to modifying the dependency scope via the Project Structure dialog, then there's a bug where it uses the wrong statement to set up the dependency. I've filed https://code.google.com/p/android/issues/detail?id=74771 for this.
I stumbled upon this post a year later. I was having this problem because I inherited an older project that was using an out-of-date Gradle build tools setting in the Gradle build file. I fixed this problem by updating Gradle build tools, which you need to do apparently by incrementing the version number in the Gradle build file:
dependencies {
classpath 'com.android.tools.build:gradle:1.X.X'
}
where X.X is the latest gradle build tools version number. Right now I'm using Android Studio v1.2 and I've got my build tools version number set to:
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
}
I came across this problem when I was trying to implement unit tests, which are now built-in to Android Studio apparently.
Hope this helps someone with the same problem.
I got this "method not found 'testcompile()'" error also. The problem was I had testCompile 'junit:junit:4.12' in my project build.gradle file and not in by app build.gradle file. How could I have known it was in the wrong file? The project file only states "NOTE: Do not place your application dependencies here; they belong in the individual module build.gradle files". Such a simple answer no wonder I couldn't find it.
I have a library project. I believed the Android documentation and put the testCompile statement in my top level build.gradle file. Turns out it actually had to go in my module build.gradle file.

Error: more than one library with package name 'com.google.android.gms'

I'm using Android Studio 0.8.2, and created a project with Android 4.1 and Android Wear 4.4. I need to integrate it with Google Play Services.
I'm trying to follow the Google Play Services setup page for Android Studio here:
https://developer.android.com/google/play-services/setup.html
In Step 2, it says to add this dependency:
compile 'com.google.android.gms:play-services:5.0.77'
However, upon Sync, I get this message:
Error:Execution failed for task ':mobile:processDebugResources'.
> Error: more than one library with package name 'com.google.android.gms'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
Here is my complete build.gradle file inside the mobile module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.OptimizedPrime.locationweartabs"
minSdkVersion 16
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.google.android.gms:play-services:5.0.77'
// You must install or update the Support Repository through the SDK manager to use this dependency.
compile 'com.android.support:support-v13:19.+'
}
It appears that the recommended dependency is conflicting with the wearable compile statement. I do want to retain wearable support, and at the same time need Google Play Services. How do I fix this?
If you have:
compile 'com.google.android.gms:play-services-wearable:5.0.77'
then you don't need:
compile 'com.google.android.gms:play-services:5.0.77'
Delete the non-wearable one.
May be possibly your are using have different types of dependencies with different versions:
com.google.android.gms:play-services-neededDependency:version
Ex: If you are using both dependencies as mention below:
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.android.gms:play-services-ads:8.3.0'
Try to use same version for different dependencies Like:
compile 'com.google.android.gms:play-services-gcm:7.8.0'
compile 'com.google.android.gms:play-services-ads:7.8.0'
Thank you, hope helpful to you.

Resources