Export To Apk Via Android Studio?

Discussion in 'How Can I...?' started by RollingStone, Sep 16, 2016.

  1. RollingStone

    RollingStone Boxer

    Joined:
    Sep 15, 2016
    Messages:
    10
    Likes Received:
    3
    Hi guys,

    I'm new to Buildbox and have a Buildbox project created by a third party.
    What I wanted to do is export from Buildbox to an Android project and then build the APK in Android Studio.

    A lot of the documentation says this is only possible via Eclipse (which I find strange, Android Studio is the official IDE for Android) but I did find some forum posts dating back last year saying that Android Studio support is coming soon. Did that ever eventuate?

    I would really rather not use Eclipse, I already use Android Studio for other projects so I tried working around this and importing the Buildbox project into Studio, had a few issues but managed to work around them. One of them was having to set android.useDeprecatedNdk=true in gradle.properties.

    Now when I get gradle syncing successfully I try to build the APK and that's where I hit the problem - I get an error saying

    Error:(1, 28) PTPAppDelegate.h: No such file or directory

    I can see that this file is imported in the main.cpp and my guess is that this file is coming from one of the jni libraries? Any idea how I can get this to work in Android Studio and get these header files included?

    I managed to build the APK in the end via the Makefile but would rather use Android Studio as my long term option.

    Thanks in advance!
     
    Gregory Storm likes this.
  2. jcalle

    jcalle Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,183
    Likes Received:
    531
    Avoid headaches.
    Use Eclipse.
     
    Christoph and Sean Buildbox like this.
  3. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,025
    hahahaha...

    classic @jcalle ... love it
     
  4. RollingStone

    RollingStone Boxer

    Joined:
    Sep 15, 2016
    Messages:
    10
    Likes Received:
    3
    So I'll take that as - no, there is still no support for Android Studio? :D

    Anyway, was just hoping someone might have tried the same thing and found the solution.
     
  5. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    Can you upload the build.gradle and gradle.properties

    Edit: I'm asking this to check your files if they are properly set, do you still have a problem?
     
    Last edited: Sep 20, 2016
  6. Gregory Storm

    Gregory Storm Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    130
    Yes. Same issue here with no solution yet. Thought I'd let you know that you're not alone on this.
     
  7. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    I don't know why you guys have this problem with AS!!

    I asked the author of this post to upload build.gradle and gradle.properties to help him but he didn't replied!!!
     
  8. Gregory Storm

    Gregory Storm Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    130
    @lqifqkt This is what I'm looking at and I would guess the other person's files would look similar.

    gradle.properties file
    Code:
    android.useDeprecatedNdk=true
    
    build.gradle file
    Code:
    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion "24.0.2"
    defaultConfig {
    applicationId "com.yyy.zzz"
    minSdkVersion 11
    targetSdkVersion 23
    ndk {
    moduleName "player_shared"
    }
    }
    
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
    }
    }
    
    dependencies {
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/PTAdFacebook.jar')
    compile files('libs/PTAdHeyzap.jar')
    compile files('libs/dagger-1.2.2.jar')
    compile files('libs/javax.inject-1.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')
    compile files('libs/support-v4-19.0.1.jar')
    }
    
     
  9. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    first change in build.gradle file
    buildToolsVersion "24.0.2"
    to
    buildToolsVersion "23.0.2"
    save

    put these two files gradle.properties and build.gradle in the app folder

    Now try
     
  10. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,379
    Likes Received:
    591
    I tried to use Android Studio and just gave up. I wanted to test my game on my Android devices but spent almost 3 hours searching out error followed by a new error followed by gradle errors - then I just download Eclipse, 3 minutes later = apk file.
     
  11. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    Eclipse is not supported by google sine 2015 !!
     
    Gregory Storm likes this.
  12. aayushxn

    aayushxn Boxer

    Joined:
    Aug 15, 2016
    Messages:
    72
    Likes Received:
    7
    I can Help You Out...!!
     
  13. jcalle

    jcalle Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,183
    Likes Received:
    531
    Eclipse works perfectly to create games BB.
    Google indicates that it is convenient to use the tool Android Studio, but not required.

    Millions of developers use Eclipse or other tools,

    Eclipse is just a compiler uses the updated Android SDK, which is a fully functional program.

    It's like whether you dincen your old car 20 years ago can not run on the road which is very old, if you pass security checks and working properly, nobody is going to stop.
     
  14. aayushxn

    aayushxn Boxer

    Joined:
    Aug 15, 2016
    Messages:
    72
    Likes Received:
    7
    @jcalle But Android Studio Is Better Than Eclipse... Though it's Authentic....
     
  15. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    Always people prefer what they are used to.. and hesitate to shift to new products specially if they faces unsolved problems at star and they give up...

    Android studio is the official product for google & android devices that comes with tons of features

    Overcome your problem of the first package building and errors and you will find that it worth shifting to it
     
    Gregory Storm likes this.
  16. Gregory Storm

    Gregory Storm Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    130
    Here's the problem with thinking that an old IDE that has been dead since 2015 is still a good thing to use. Since Eclipse is dead that means at some point other 3rd-party SDKs and Google will stop making updates that will be supported by Eclipse. Analytics, AdMob, Firebase, already have removed Eclipse support from their main docs and Android Studio is now required by Google Analytics.

    Using Eclipse instead of Android Studio is like using Xcode 5 to build your new iOS apps when Apple is on Xcode 8. It might work but it won't have all the current features.
     
    Christoph likes this.
  17. Gregory Storm

    Gregory Storm Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    130
    I made those changes, but still get the same errors. I don't see these files that are referenced in main.cpp anywhere in the project folders.
    Code:
    #include "PTPAppDelegate.h"
    #include "cocos2d.h"
    #include "PTPConfig.h"
    #include "models/PTModelController.h"
    #include "PTPSettingsController.h"
    #include "platform/android/jni/JniHelper.h"
     
  18. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    I will try to make a video tutorial on the latest BB and AS....
     
    Gregory Storm likes this.
  19. Gregory Storm

    Gregory Storm Avid Boxer

    Joined:
    Sep 25, 2015
    Messages:
    169
    Likes Received:
    130
    A video would be great. In the meantime, I don't see the mentioned files in the Android Studio project. What was your solution for that?
     
  20. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,379
    Likes Received:
    591
    Something official from Buildbox would be handy on this. Android Studio should really be supported, especially with all the new functions and features on Android
     

Share This Page