Gradle build error

Hi,

Just revisit my old project https://github.com/zean00/fuse-qreader, and encounter different issue than before. However, I managed to get my code running, but I have to tune it manually with Android studio, below is my notes related the issue I encountered

The annotation

[Require("Gradle.Dependencies.Compile","com.google.android.gms:play-services:9.2.1")]

doesn’t generate correct list of compile dependency on gradle build file, hence the fuse build command will result error immediately

This code

android.support.v7.app.AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

causing compilation error when building through Android Studio, it says that the method setCompatVectorFromResourcesEnabled is not recognised, I have to comment that code to continue the build

Since I update the google play services version, it requires to enable multidex support. I don’t know how to enable it through fuse code, hence I have to set up manually in gradle build file and AndroidManifest file

Hi Sahal,

Sorry that this has affected your project.

Let’s get the basics out of the way first. How are you building the project?

Hi,

As mentioned in the original post https://www.fusetools.com/community/forums/show_and_tell/qr_code_scanner

I use command fuse build -t=android -DGRADLE -r --set:SDK.BuildToolsVersion="23.0.1" --set:SDK.CompileVersion="23" --set:SDK.TargetVersion="23" QreaderLibrary.unoproj

That command results lot of error message, but I expect that it generates gradle compile dependency as I stated in the uno code

[Require("Gradle.Dependencies.Compile","com.android.support:support-v4:23.0.1")]
[Require("Gradle.Dependencies.Compile","com.google.android.gms:play-services:9.2.1")]
[Require("Gradle.Dependencies.Compile","com.android.support:design:23.0.1")]

Instead, I only get this in build.gradle file

compile fileTree(dir: 'src/main/libs', include: ['*.jar'])
compile 'com.android.support:support-v4:+'
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'

And when I compile the generated code / gradle project with Android studio, I got that AppCompat compilation error which was not the case previously (build 0.20 - currently I’m using build 0.27)

Hi Sahal,

I am struggling to work out what the issue may be. Is it possible to send us a copy of the project?
If yes then the link for our dropbox is here: https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK

Thanks and sorry for the slow reply

done. just upload the file to provided link.

Thanks, I have made today free so I can focus on this. I’m sure we will have some news soon

I have found one issue so far:

The guide https://www.fusetools.com/docs/native-interop/preliminary-gradle-support says the annotation looks like this:

[Require("Gradle.Dependency.Compile", "foobar")]

But you are using

[Require("Gradle.Dependencies.Compile","foobar")]

This is why the gradle dependencies arent in the file.

The next issue I hit was the 64k method limit which happens a lot with google’s Play Services. No worries, Fuse with Gradle supports all the AARs google stuff so we just use

[Require("Gradle.Dependency.Compile","com.google.android.gms:play-services-vision:+")]

And your project builds :slight_smile:

Hi,

Perfect. This is work now. Just quick question, what if I need specific version of google play service and 64k problem is there, is there any way in fuse to support multidex?

Well for versions I use replace the + from the Gradle.Dependency.Compile with the version number.

We don’t have multidex support yet but if this proves to be needed we could add it to our internal roadmap.