Correcting Dependency and Version Issues attempting to compile code

  • Replies:1
John Tekker
  • Forum posts: 1

Mar 25, 2019, 2:53:50 PM via Website

Hello All,

I am new with programming for Android and could use some help compiling someone else's code I have as I am attempting to test a older App for educational use and debugging experience. I have not yet been able to get the code to run, and I have done some searches and tried a few approaches already without luck so I am just hoping someone may point me in to the right direction of what I am missing.

I believe most of my issues may lie in versioning of old dependencies so I have been trying to compile with older version of Android Studio (as well as current version initially) along with matching versions of Gradle and React-Native, all without luck. Here are the version details I can see from the code...

From looking at the code I know it is using:

React-Native 0.53.3

Yarn Package Manager

Gradle 2.2.3

From Top level build.gradle:

  dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'
....
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"

From sub level build.gradle:

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

From gradle-wrapper.properties:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

At this point I have multiple copies of the code that I have tried different gradle versions and react-native versions along with current and older Android studio with a plethora of different compile issues with each setup that I have not been able to solve so I think it may be best for me to start again with a clean version of the code as a new AS project, and I hope some of you more experienced guys might be able to point me in the right direction for setting this up to get it to compile.

Should I try again to match the original AS version, Gradle Version, and React Native version the code was written for? Is their anything I am missing or just try to compile from there and debug errors that arise?

I just did a Quick test on Studio 2.3.3 - I select import gradle and select the build.gradle from the source code.

Error:(79, 0) Could not read script 'C:\...\node_modules\react-native\react.gradle' as it does not exist."
I then run npm install in project root directory

Sync Gradle Build and run I get:

"Unable to load script from assets 'index.android.bundle' Make sure your bundle is package correctly or your running a packager server"

Build errors on Studio 3.3.1:

> "ERROR: Could not get unknown property 'mergeResourcesProvider' for
> object of type
> com.android.build.gradle.internal.api.ApplicationVariantImpl."

Any help and suggestions are truly appreciated!

Reply
James Watson
  • Forum posts: 1,584

Mar 25, 2019, 4:12:44 PM via Website

It seems that some versions are too old?

gradle-2.14.1-all.zip -> gradle-4.10.1-all.zip
Gradle 2.2.3 -> Gradle 3.3.0
...

Download size < 0.15 MB. But also accurate enough, ad-free & free.
The minimalist app available on Play Store: https://goo.gl/ws42fN
Blog: https://okblackcafe.blogspot.com Your 5-star is appreciated.

Helpful?
Reply