0

I am trying to import this project app from GitHub, but something is wrong about the versions. Android-App-From-Responsive-Website-NavDrawer.

I tried the post Unsupported method: BaseConfig.getApplicationIdSuffix(), but nothing helped.

Gradle sync failed: Unsupported method: BaseConfig.getApplicationIdSuffix(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you connect to. Alternatively, you can ignore this exception and read other information from the model. (6 s 306 ms)

My build.gradle file

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

    allprojects {
        repositories {
            jcenter()
        }
    }

    task clean(type: Delete) {
        delete rootProject.buildDir
    }
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131

1 Answers1

1

This is an old project and needs to be updated in order to compile on current Android Studio versions, and in order to be publishable on Play Store.

I was able to compile it by upgrading to Gradle 2.3.3 and and SDK Version 25.

Following is the diff: remove the lines starting with - minus sign and add the lines starting with the + plus sign. You don't need to add/remove curly braces.

build.gradle:

-        classpath 'com.android.tools.build:gradle:1.3.0'
+        classpath 'com.android.tools.build:gradle:2.3.3'

After doing the above change, Build the Project. It's going to fail. Now, click on Fix Gradle wrapper and reimport project present on Build Console. Then follow the next diff.

app/build.gradle:

 android {
-    compileSdkVersion 23
-    buildToolsVersion "23.0.1"
+    compileSdkVersion 25
+    buildToolsVersion "25.0.1"

 defaultConfig {
     applicationId "com.mywebsite.mywebsite"
     minSdkVersion 14
-    targetSdkVersion 23
+    targetSdkVersion 25
     versionCode 1
     versionName "1.0"
 }

 dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
 -    compile 'com.android.support:appcompat-v7:23.0.0'
 -    compile 'com.android.support:design:23.0.0'
 +    compile 'com.android.support:appcompat-v7:25.0.0'
 +    compile 'com.android.support:design:25.0.0'
  }
diogenesgg
  • 2,601
  • 2
  • 20
  • 29
  • Edited my answer – diogenesgg Feb 07 '19 at 21:56
  • there is no Fix Gradle wrapper and reimport project – StonebridgeGR Feb 07 '19 at 22:00
  • got it and working, and i can run on my phone BUT, there is a windo the a message Please Wait.. Website is loading.... and keep looping for ever. where is this file and how to fix it – StonebridgeGR Feb 07 '19 at 22:09
  • I'm also facing this same popup message. I clicked outside of it, then it disappeared. At least it was able to load some content, like News report. – diogenesgg Feb 07 '19 at 22:13
  • yea probably the time within the phone contact with their servers any ways i added my own sites. BUT the first one when the app is loading says to open the site google chrome's apps from phone i dont want that i want when someone opening the app to open just there ON THE APP not external apps. – StonebridgeGR Feb 07 '19 at 22:15
  • dude? you know how to fix it? – StonebridgeGR Feb 07 '19 at 22:46
  • No, since you're pointing now to your sites, I don't know what is it exactly you're trying to do, and what exactly errors you're getting. By the way, your question should actually be something along the lines: `How to import an old Gradle 1.3 Android project on Android Studio $YourAndroidVersion`. Don't be afraid to post a new question with a detailed description, and in a way the community can reproduce your error. – diogenesgg Feb 07 '19 at 22:56
  • I fixed that problem with your solution sir, i made another post if you want https://stackoverflow.com/questions/54583582/the-site-loads-from-external-google-chrome-inside-webvie – StonebridgeGR Feb 07 '19 at 22:57
  • sir?any answer? – StonebridgeGR Feb 08 '19 at 22:35