Log in or register to post comments

android studio doesn't create JAR file

August 28, 2017 - 8:10pm #1

Good morning

I was trying to create a plug-in,

It is called BUILD SUCCESSFUL but there is no release folder and there is no jar file.

Http://dolphin.ivyro.net/file/mobile/unity/runPluginAndroidStudio01.html

URL that i'm referenced

Note :  I will append the code in the order of MainActivity AndroidPlugin app

I would appreciated your help.

PS. I'm not good english so i using  google translate

even if text was not good please understand me

===========================================

package sd.androidplugin;

//import android.support.v7.app.AppCompatActivity;

import android.os.Bundle;

import com.unity3d.player.UnityPlayer;

import com.unity3d.player.UnityPlayerActivity;

public class MainActivity extends UnityPlayerActivity {

    @Override

    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        //setContentView(R.layout.activity_main);

        //call from native

        UnityPlayer.UnitySendMessage("Main Camera","CallFromNative","NativeCallFromUnity call test");

            }

    public String CallByUnityString(String a){

        return "Plugin Object: "+a;

    }

}

===========================================

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {

        jcenter()

    }

    dependencies {

        classpath 'com.android.tools.build:gradle:2.3.3'

        // 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

}

===========================================

apply plugin: 'com.android.application'

android {

    compileSdkVersion 26

    buildToolsVersion "26.0.1"

    defaultConfig {

        //applicationId "sd.androidplugin"

        minSdkVersion 15

        targetSdkVersion 26

        //versionCode 1

        //versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    }

    buildTypes {

        release {

            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }

    }

}

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

        exclude group: 'com.android.support', module: 'support-annotations'

    })

    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'

    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    testCompile 'junit:junit:4.12'

    compile files('libs/classes.jar')

}

//task: 이전 jar 파일을 지운다. 여기서는 AndroidPlugin.jar 파일이다.

task deleteOldJar(type: Delete) {

    delete 'release/AndroidPlugin.jar'

}

//task: jar 파일로 익스포트 한다. 여기서는 AndroidPlugin.jar 파일이다.

task exportJar(type: Copy) {

    from('build/intermediates/bundles/default/')

    into('release/')

    include('classes.jar')

    ///Rename the jar

    rename('classes.jar', 'AndroidPlugin.jar')

}

//exportJar 작업은 ,deleteOldJar 작업에 의존한다.

exportJar.dependsOn(deleteOldJar, build)

===========================================

Log in or register to post comments