Tinker app source code for Android


#1

Hello,

is there a source a tinker app source code for Android available? It looks like there’s Particle_android Git repo but I don’t see Tinker app. There’s an iOS Tinker app source code so it’s strange there’s no Android version as well.


#2

This repo seems to me to contain the Android App sources which include the Tinker features.

You can search the repo
https://github.com/particle-iot/particle-android/search?&q=tinker&unscoped_q=tinker


#3

Thanks.
The reason I asked is because I can’t seem to build any of the projects, I’m getting an error:

This version of Android Studio cannot open this project, please retry with Android Studio 3.5 or newer.

I thought if Tinker app is open source it would successfully build and that could be my starting point. As of right now nothing builds and I don’t know the cause.

Has anyone else seen this issue with the repo?


#4

I downloaded a beta version of Android 3.5 and now I’m getting the following failure:

File google-services.json is missing. The Google Services Plugin cannot function without it.

What is this for ?
Particle Team, why is the Android SDK so buggy? Shouldn’t this work ???
This is very frustrating.


#5

I think I saw you also post in a thread tagging @jensck_particle - he should know best.


Please don’t spawn any more threads for the same “issue”.
You already have multiple threads dealing with this - lets stick to one and don’t open any new ones. This would only skatter the discussion and won’t attract any more (positive) attention.


#6

Ok. I thought since the error was different that it’s a different issue but I guess it is related to SDK issue.


#7

You’re right, the app should build correctly, without special instructions, just by cloning the repo. (With the occasional exception of requiring Android Studio beta versions, which I think is a reasonable requirement for anyone cloning the repo. It may be mildly annoying, but I only require AS betas when it provides a meaningful velocity boost on my end.)

Anyway, the google-services.json issue will be fixed in the next couple days, but for now, try commenting out the lines:

apply plugin: 'io.fabric'

and

apply plugin: 'com.google.gms.google-services'

which are found near the beginning and end of the file, respectively.

Let me know if you still have any issues after trying that.


New repository for all Particle Android projects!
#8

In what file should I make this change?
Android Studio can’t find google-services.json.


#9

I commented out those two lines in gradle script and that seemed to have worked.

Now I got resource error:

AAPT: error: resource drawable/product_image_photon (aka io.particle.devicesetup.testapp:drawable/product_image_photon) not found.

At least i’m moving in the right direction :slight_smile:


#10

Ah, the sample apps are having trouble.

Open settings.gradle and comment out the following lines:

sdk_example_app
setup_testapp
setup_exampleapp

I’ll get these fixed shortly, too, but I just tried checking out and building from a freshly-cloned copy of the repo, and it worked after making this change and the gradle plugin changes. Sorry for the hassle.


#11

I commented those 3 lines and then I got the following errors:

| — | — |
|Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class io.particle.firmwareprotos.ctrl.Common.IpAddress, unresolved supertypes: io.particle.firmwareprotos.ctrl.Common.IPAddressOrBuilder||

|C:/particle-android-master(1)/particle-android-master||
|mesh/src/main/java||
|io/particle/mesh/setup/flow/setupsteps/StepEnsureEthernetHasIpAddress.kt||
|Unresolved reference: v4||
|Unresolved reference: v6||

So I have to add some dependancies maybe.
the error is pointing to line 37 in file StepEnsureEthernetHasIpAddress.kt :

it.address.v4.address.truthy() || it.address.v6.address.truthy()


#12

Strange. I just checked out the project fresh from the repo and (after making those plugin/settings.gradle changes), it worked fine.

Can you verify that you have the following file in your repo directory?
photon-tinker-android/firmwareprotos/src/main/java/io/particle/firmwareprotos/ctrl/Common.java


#13

My repo starts with particle-android , not photon-tinker-android. Besides that I do have Common.java.


#14

Could you explain the steps you took to make it all work? I want to make sure I’m not doing anything weird.

Thanks


#15

What you have locally should match what I have now that you’ve made that settings.gradle change. Can you try cd-ing to particle-android/app and then running: ..\gradle.bat assembleDebug

That should build the APK for you. Out of curiousity, are you able to build other projects/apps with this Android Studio installation?


#16

I don’t have gradle.bet in /app directory.


#17

To answer your second question, I haven’t tried any other projects besides particle with this AS installation.


#18

Sorry, I meant gradlew.bat (I’m not sure if you need to type the .bat part; I haven’t used Windows in forever.)


#19

I ran “gradleew assembleDebug” and got the following output:

Starting a Gradle Daemon, 2 incompatible Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/5.4.1/userguide/gradle_daemon.html
    Process command line: C:\Program Files (x86)\Java\jre1.8.0_60\bin\java.exe -Xmx1536M -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\301312.gradle\wrapper\dists\gradle-5.4.1-all\3221gyojl5jsh0helicew7rwx\gradle-5.4.1\lib\gradle-launcher-5.4.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 5.4.1
    Please read the following process output to find out more:

Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org